mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user