From 8e6cff9b5d93bcec1a1d0b0528ac94f294d4de21 Mon Sep 17 00:00:00 2001 From: Flugente Date: Sat, 12 Aug 2017 12:45:33 +0000 Subject: [PATCH] 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 --- Tactical/Handle Items.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index 7d9858d2f..2526509f0 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -9667,7 +9667,8 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name ) ammoitem = (*pObj)[i]->data.gun.usGunAmmoItem; for ( std::vector::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;