mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +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:
@@ -1642,18 +1642,31 @@ void HandleLeavingOfEquipmentInCurrentSector( UINT32 uiMercId )
|
||||
}
|
||||
|
||||
UINT32 invsize = Menptr[ uiMercId ].inv.size();
|
||||
for( UINT32 iCounter = 0; iCounter < invsize; ++iCounter )
|
||||
UINT32 uiFoundItems = 0;
|
||||
Inventory invTemporaryBeforeDrop;
|
||||
|
||||
if( Menptr[ uiMercId ].sSectorX != gWorldSectorX || Menptr[ uiMercId ].sSectorY != gWorldSectorY || Menptr[ uiMercId ].bSectorZ != gbWorldSectorZ )
|
||||
{
|
||||
// slot found,
|
||||
// check if actual item
|
||||
if( Menptr[ uiMercId ].inv[ iCounter ].exists() == true )
|
||||
for( UINT32 iCounter = 0; iCounter < invsize; ++iCounter )
|
||||
{
|
||||
if( Menptr[ uiMercId ].sSectorX != gWorldSectorX || Menptr[ uiMercId ].sSectorY != gWorldSectorY || Menptr[ uiMercId ].bSectorZ != gbWorldSectorZ )
|
||||
// slot found,
|
||||
// check if actual item
|
||||
if( Menptr[ uiMercId ].inv[ iCounter ].exists() == true )
|
||||
{
|
||||
// Set flag for item...
|
||||
AddItemsToUnLoadedSector( Menptr[ uiMercId ].sSectorX, Menptr[ uiMercId ].sSectorY, Menptr[ uiMercId ].bSectorZ , sGridNo, 1, &( Menptr[ uiMercId ].inv[ iCounter ]) , Menptr[ uiMercId ].pathing.bLevel, WOLRD_ITEM_FIND_SWEETSPOT_FROM_GRIDNO | WORLD_ITEM_REACHABLE, 0, 1, FALSE );
|
||||
invTemporaryBeforeDrop[uiFoundItems] = Menptr[ uiMercId ].inv[ iCounter ];
|
||||
uiFoundItems++;
|
||||
}
|
||||
else
|
||||
}
|
||||
// anv: add all items at once (less file operations = less lag)
|
||||
AddItemsToUnLoadedSector( Menptr[ uiMercId ].sSectorX, Menptr[ uiMercId ].sSectorY, Menptr[ uiMercId ].bSectorZ , sGridNo, uiFoundItems, &(invTemporaryBeforeDrop[0]) , Menptr[ uiMercId ].pathing.bLevel, WOLRD_ITEM_FIND_SWEETSPOT_FROM_GRIDNO | WORLD_ITEM_REACHABLE, 0, 1, FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
for( UINT32 iCounter = 0; iCounter < invsize; ++iCounter )
|
||||
{
|
||||
// slot found,
|
||||
// check if actual item
|
||||
if( Menptr[ uiMercId ].inv[ iCounter ].exists() == true )
|
||||
{
|
||||
AddItemToPool( sGridNo, &( Menptr[ uiMercId ].inv[ iCounter ] ) , 1, Menptr[ uiMercId ].pathing.bLevel, WORLD_ITEM_REACHABLE, 0 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user