If the itemlist is huge and one uses New Inventory System, New Attachment System and a lot of MOLLE items, there is a noticable slowdown if inventory is open in tactical. I cleaned up code to ease that somewhat, but the problem will likely persist.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7600 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2014-10-19 21:53:05 +00:00
parent 5dbcf2a1e8
commit 499ff2db06
24 changed files with 674 additions and 702 deletions
+4 -5
View File
@@ -1683,11 +1683,11 @@ void GiveIMPRandomItems( MERCPROFILESTRUCT *pProfile, UINT8 typeIndex )
BOOLEAN ubItemsGiven[ 50 ]={FALSE};
// check how many legal items are in the choices list, this is to prevent infinite loop
for ( UINT8 cnt=0; cnt < ubNumChoices; cnt++ )
for ( UINT8 cnt=0; cnt < ubNumChoices; ++cnt )
{
usItem = gIMPItemChoices[ typeIndex ].bItemNo[ cnt ];
if ( ItemIsLegal(usItem) )
ubValidChoices++;
++ubValidChoices;
}
// if no valid items found, bail out
@@ -1702,7 +1702,7 @@ void GiveIMPRandomItems( MERCPROFILESTRUCT *pProfile, UINT8 typeIndex )
// give us the maximum possible
ubNumItemsToGive = gIMPItemChoices[typeIndex].ubNumItems;
for ( int i=0; i < ubNumItemsToGive ;i++ )
for ( int i=0; i < ubNumItemsToGive; ++i )
{
usItem = 0;
while (usItem == 0 )
@@ -1720,7 +1720,7 @@ void GiveIMPRandomItems( MERCPROFILESTRUCT *pProfile, UINT8 typeIndex )
MakeProfileInvItemAnySlot(pProfile,usItem,100,1);
// give ammo for guns
Assert(usItem<MAXITEMS);
Assert( usItem < gMAXITEMS_READ );
if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
{
usItem = DefaultMagazine(usItem);
@@ -1736,7 +1736,6 @@ void GiveIMPRandomItems( MERCPROFILESTRUCT *pProfile, UINT8 typeIndex )
MakeProfileInvItemAnySlot(pProfile,usItem,100,(2+Random(2)));
}
}
}
void GiveIMPItems( MERCPROFILESTRUCT *pProfile, INT8 abilityValue, UINT8 typeIndex )