Enabled default attachments to be loaded on soldiers' items, even if the attachments are added after placing the soldiers in the map editor

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5272 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
MaddMugsy
2012-05-14 19:44:21 +00:00
parent b541d759a8
commit d4c26bc4a2
2 changed files with 15 additions and 1 deletions
+14
View File
@@ -2585,7 +2585,21 @@ BOOLEAN OBJECTTYPE::Load( INT8** hBuffer, float dMajorMapVersion, UINT8 ubMinorM
LOADDATA( &OldSavedObject101, *hBuffer, sizeof(OLD_OBJECTTYPE_101) );
(*this) = OldSavedObject101;
}
RemoveProhibitedAttachments(NULL, this, (*this).usItem);
//Madd: ok, so this drives me nuts -- why bother with default attachments if the map isn't going to load them for you?
//this should fix that...
for(UINT8 cnt = 0; cnt < MAX_DEFAULT_ATTACHMENTS; cnt++)
{
if(Item [ (*this).usItem ].defaultattachments[cnt] == 0)
break;
OBJECTTYPE defaultAttachment;
CreateItem(Item [ (*this).usItem ].defaultattachments[cnt],100,&defaultAttachment);
this->AttachObject(NULL,&defaultAttachment, FALSE);
}
return TRUE;
}