mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Little Alien
New feature: Rearrange sector inventory - Press Shift+S in tactical to rearrange sector inventory - Tactical militia command: "Find Items" menu disabled - Tactical militia command: orders to dying militia now not possible git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@69 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -224,7 +224,7 @@ void HandleStealthChangeFromUIKeys( );
|
||||
|
||||
UINT8 gubCheatLevel = STARTING_CHEAT_LEVEL;
|
||||
|
||||
|
||||
extern void StackObjs( OBJECTTYPE * pSourceObj, OBJECTTYPE * pTargetObj, UINT8 ubNumberToCopy );
|
||||
extern BOOLEAN CompatibleAmmoForGun( OBJECTTYPE *pTryObject, OBJECTTYPE *pTestObject );
|
||||
extern void DetermineWhichAssignmentMenusCanBeShown( void );
|
||||
extern void DetermineWhichMilitiaControlMenusCanBeShown( void ); //lal
|
||||
@@ -3067,6 +3067,8 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
HandleStanceChangeFromUIKeys( ANIM_PRONE );
|
||||
break;
|
||||
|
||||
|
||||
|
||||
// Make auto reload with magazines from sector inventory
|
||||
case 'R':
|
||||
if (! (gTacticalStatus.uiFlags & INCOMBAT) )
|
||||
@@ -3094,7 +3096,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
// Search for ammo in sector
|
||||
for ( UINT32 uiLoop = 0; uiLoop < guiNumWorldItems; uiLoop++ )
|
||||
{
|
||||
if ( gWorldItems[ uiLoop ].fExists) //item exists
|
||||
if ( gWorldItems[ uiLoop ].fExists) //item exists && (gWorldItems[ uiLoop ].usFlags & WORLD_ITEM_REACHABLE)
|
||||
{
|
||||
if ( ( Item[ gWorldItems[ uiLoop ].o.usItem ].usItemClass & IC_AMMO ) ) // the item is ammo
|
||||
{
|
||||
@@ -3188,6 +3190,35 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case 'S':
|
||||
|
||||
if (! (gTacticalStatus.uiFlags & INCOMBAT) )
|
||||
{
|
||||
for ( UINT32 uiLoop = 0; uiLoop < guiNumWorldItems; uiLoop++ )
|
||||
{
|
||||
if ( ( gWorldItems[ uiLoop ].fExists) && (gWorldItems[ uiLoop ].usFlags & WORLD_ITEM_REACHABLE) )//item exists and is reachable
|
||||
{
|
||||
//find out how many items can be put in a big slot
|
||||
INT8 ubSlotLimit = ItemSlotLimit( gWorldItems[ uiLoop ].o.usItem, BIGPOCK1POS );
|
||||
|
||||
//if we still have some space
|
||||
if ( gWorldItems[ uiLoop ].o.ubNumberOfObjects < ubSlotLimit )
|
||||
{
|
||||
//if the next item is the same
|
||||
if ( gWorldItems[ uiLoop ].o.usItem == gWorldItems[ uiLoop + 1 ].o.usItem )
|
||||
{
|
||||
INT8 ubObjCount = ubSlotLimit - gWorldItems[ uiLoop ].o.ubNumberOfObjects;
|
||||
INT8 bPointsToMove = __min( ubObjCount, gWorldItems[ uiLoop +1 ].o.ubNumberOfObjects );
|
||||
|
||||
StackObjs( &(gWorldItems[ uiLoop +1 ].o), &(gWorldItems[ uiLoop ].o), bPointsToMove);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 's':
|
||||
|
||||
if( fCtrl )
|
||||
|
||||
Reference in New Issue
Block a user