1. Removed hardcoding of face items in the code for the face icons / graphics

2. Fixed potential infinite loop bug if no ammo crate or box is present and (ctrl+)shift+a is pressed.
3. Changed Ctrl click on mapscreen from Delete to auto-place item in selected merc or vehicle inventory.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5179 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
MaddMugsy
2012-04-10 20:41:04 +00:00
parent 74c6e3c56c
commit ab3412e5ed
5 changed files with 105 additions and 64 deletions
+7 -3
View File
@@ -2589,6 +2589,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
INT32 worldItem;
UINT8 magType;
bool mergeSuccessful, ammoPresent;
int loopCount = 0;
OBJECTTYPE newCrate;
ammoPresent = true;
@@ -2597,7 +2598,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
else
magType = AMMO_BOX;
while (ammoPresent)
while (ammoPresent && loopCount <= 10)
{
//look through all sector items for ammo.
for(unsigned int wItem = 0; wItem < guiNumWorldItems; wItem++)
@@ -2685,11 +2686,13 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
}
}
}
else // MM: no crate item, so we must be missing a crate item from the xmls. Set ammoPresent to false to avoid infinitely looping.
ammoPresent = false;
}
}
// if we added to / created a box/crate, then we're fine to reset this
if ( mergeSuccessful )
loopCount = 0;
//MM: loop through ammo multiple times, as boxes and crates may take a few passes to fill
ammoPresent = false;
for(unsigned int wItem = 0; wItem < guiNumWorldItems; wItem++)
@@ -2700,6 +2703,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
if(Magazine[Item[worldItem].ubClassIndex].ubMagType == magType)
continue;
loopCount++;
ammoPresent = true;
break;
}