Gear templates: An entry with '0' and a valid ammo item will try to fit that ammo to any gun used in the slot

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8447 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2017-08-12 12:45:33 +00:00
parent b64e0d0f91
commit 8e6cff9b5d
+2 -1
View File
@@ -9667,7 +9667,8 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name )
ammoitem = (*pObj)[i]->data.gun.usGunAmmoItem;
for ( std::vector<GEAR_NODE>::iterator it = vec.begin( ); it != vec.end( ); ++it )
{
if ( (*it).slot == slot && (*it).item == pObj->usItem )
// use the ammotype of the node, provided it exists and fits the gun or a wildcard
if ( (*it).slot == slot && (*it).ammoitem != NOTHING && ( (*it).item == pObj->usItem || (*it).item == NOTHING ) )
{
ammoitem = (*it).ammoitem;
break;