mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +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) );
|
LOADDATA( &OldSavedObject101, *hBuffer, sizeof(OLD_OBJECTTYPE_101) );
|
||||||
(*this) = OldSavedObject101;
|
(*this) = OldSavedObject101;
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveProhibitedAttachments(NULL, this, (*this).usItem);
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ drugsEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
else if(strcmp(name, "name") == 0)
|
else if(strcmp(name, "name") == 0)
|
||||||
{
|
{
|
||||||
pData->curElement = ELEMENT;
|
pData->curElement = ELEMENT;
|
||||||
// not needed, but its there :-(
|
// not needed, but its there for informational purposes
|
||||||
}
|
}
|
||||||
else if(strcmp(name, "ubDrugTravelRate") == 0)
|
else if(strcmp(name, "ubDrugTravelRate") == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user