mirror of
https://github.com/1dot13/source.git
synced 2026-08-26 14:30:26 +02:00
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:
@@ -674,6 +674,20 @@ void LoadWorldItemsFromMap( INT8 **hBuffer, float dMajorMapVersion, int ubMinorM
|
|||||||
{ //all armed bombs are buried
|
{ //all armed bombs are buried
|
||||||
dummyItem.bVisible = 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 );
|
AddItemToPoolAndGetIndex( dummyItem.sGridNo, &dummyItem.object, dummyItem.bVisible, dummyItem.ubLevel, dummyItem.usFlags, dummyItem.bRenderZHeightAboveLevel, dummyItem.soldierID, &iItemIndex );
|
||||||
gWorldItems[ iItemIndex ].ubNonExistChance = dummyItem.ubNonExistChance;
|
gWorldItems[ iItemIndex ].ubNonExistChance = dummyItem.ubNonExistChance;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user