Made it so default attachments are added to items even if they are not present when the map is created in the map editor

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5255 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
MaddMugsy
2012-05-03 18:46:36 +00:00
parent b02e37d883
commit 021a8fc85f
+14
View File
@@ -674,6 +674,20 @@ void LoadWorldItemsFromMap( INT8 **hBuffer, float dMajorMapVersion, int ubMinorM
{ //all armed bombs are buried
dummyItem.bVisible = BURIED;
}
//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 [ dummyItem.object.usItem ].defaultattachments[cnt] == 0)
break;
//cannot use gTempObject
static OBJECTTYPE defaultAttachment;
CreateItem(Item [ dummyItem.object.usItem ].defaultattachments[cnt],100,&defaultAttachment);
dummyItem.object.AttachObject(NULL,&defaultAttachment, FALSE);
}
AddItemToPoolAndGetIndex( dummyItem.sGridNo, &dummyItem.object, dummyItem.bVisible, dummyItem.ubLevel, dummyItem.usFlags, dummyItem.bRenderZHeightAboveLevel, dummyItem.soldierID, &iItemIndex );
gWorldItems[ iItemIndex ].ubNonExistChance = dummyItem.ubNonExistChance;
}