mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
When stacking ammo or kits, make the partially full object be the first instead of last on the stack
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8463 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -7072,6 +7072,23 @@ void CleanUpStack( OBJECTTYPE * pObj, OBJECTTYPE * pCursorObj )
|
||||
DistributeStatus(pCursorObj, pObj, bMaxPoints);
|
||||
}
|
||||
DistributeStatus(pObj, pObj, bMaxPoints);
|
||||
|
||||
// Flugente: one of the items on the stack might not be full. Make sure it is the first one, so the player can see what is missing at a glance
|
||||
if ( pObj->ubNumberOfObjects > 1 )
|
||||
{
|
||||
if ( Item[pObj->usItem].usItemClass & IC_AMMO )
|
||||
{
|
||||
UINT16 shots_first = (*pObj)[0]->data.ubShotsLeft;
|
||||
(*pObj)[0]->data.ubShotsLeft = (*pObj)[pObj->ubNumberOfObjects - 1]->data.ubShotsLeft;
|
||||
(*pObj)[pObj->ubNumberOfObjects - 1]->data.ubShotsLeft = shots_first;
|
||||
}
|
||||
else if ( Item[pObj->usItem].usItemClass & IC_MAPFILTER_KIT )
|
||||
{
|
||||
INT16 status_first = (*pObj)[0]->data.objectStatus;
|
||||
(*pObj)[0]->data.objectStatus = (*pObj)[pObj->ubNumberOfObjects - 1]->data.objectStatus;
|
||||
(*pObj)[pObj->ubNumberOfObjects - 1]->data.objectStatus = status_first;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UINT8 FindNextMercInTeamPanel( SOLDIERTYPE *pSoldier, BOOLEAN fGoodForLessOKLife, BOOLEAN fOnlyRegularMercs )
|
||||
|
||||
Reference in New Issue
Block a user