mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
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:
@@ -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 )
|
||||
|
||||
Reference in New Issue
Block a user