mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Merged from revision: 7138
Bugfixes (by anv) - autofeeding bug, - drop items on dismiss optimization, - effectiveness of suppression was increased/decreased with every influenced soldier if set to other than default 100, - item status changed to INT16 on item create - item status is also used to specify amount of money (*50), if NPC had a lot of money in his starting gear, its amount would be incorrect. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7139 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -847,18 +847,20 @@ BOOLEAN AddItemsToUnLoadedSector( INT16 sMapX, INT16 sMapY, INT8 bMapZ, INT32 sG
|
||||
DeleteTempItemMapFile( sMapX, sMapY, bMapZ );
|
||||
}
|
||||
|
||||
UINT16 uiLastFoundSpot = 0;
|
||||
//loop through all the objects to add
|
||||
for( uiLoop1=0; uiLoop1 < uiNumberOfItemsToAdd; uiLoop1++)
|
||||
{
|
||||
//Loop through the array to see if there is a free spot to add an item to it
|
||||
for( cnt=0; cnt < uiNumberOfItems; cnt++)
|
||||
for( cnt=uiLastFoundSpot; cnt < uiNumberOfItems; cnt++)
|
||||
{
|
||||
if( pWorldItems[ cnt ].fExists == FALSE )
|
||||
{
|
||||
// anv: remember first found free spot to not loop through entire inventory again for next added items
|
||||
uiLastFoundSpot = cnt;
|
||||
//We have found a free spot, break
|
||||
break;
|
||||
}
|
||||
}
|
||||
} }
|
||||
|
||||
if( cnt == ( uiNumberOfItems ) )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user