mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Merged revision(s) 7166-7177 from branches/ja2_source_official_2014:
- Flagmasks are unsigned, and should be called and treated as such - Fix: experience gain from interrogation was too high - Fix: chance of a prisoner becoming militia was calculated wrong - default weight maximum for MOVE ITEM assignment increased from 30 to 40 kg - Fix: snitches report the same event multiple times - Fix: snitches treat vehicles as persons - Fix: selection of launchables is inefficient, an does not take into account wether items are depending on day/night cycle - new key combination: in strategic, pressing [CTRL] + [E] wile both a merc's inventory and the sector inventory are open will fill the merc's inventory with sector items - trivial code cleanup - if prisoners are taken in a sector that houses a prison, that prison can also be selected to house them - Fix: distributing newly taken prisoners in a prison sector no longer redistributes all prisoners, only the new ones - GetClosestFlaggedSoldierID can also be called without evaluation of sight - Fix: Covert Ops: throwing/lobbing items or shooting rockets is deemed suspicious behaviour - Fix: boxing was broken by loading a savegame - Fix: campaign history rarely recorded kills in autoresolve - There is no reason why the IDs that boxers are reset to before they are reinitialised would ever need to be altered by a modder. Required script change in stable GameDir r2024. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7178 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+65
-22
@@ -7558,36 +7558,79 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
}
|
||||
if( fCtrl )
|
||||
{
|
||||
//CHRISL: pickup all items to vehicle
|
||||
if ( UsingNewInventorySystem() == true && fShowInventoryFlag && fShowMapInventoryPool && !(gTacticalStatus.fEnemyInSector) && gGameExternalOptions.fVehicleInventory && (pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE))
|
||||
if ( UsingNewInventorySystem() && fShowInventoryFlag && fShowMapInventoryPool && !gTacticalStatus.fEnemyInSector)
|
||||
{
|
||||
for(unsigned int i = 0; i<pInventoryPoolList.size(); i++)
|
||||
//CHRISL: pickup all items to vehicle
|
||||
if ( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE )
|
||||
{
|
||||
if(pInventoryPoolList[i].fExists == TRUE && (pInventoryPoolList[i].usFlags & WORLD_ITEM_REACHABLE))
|
||||
if (gGameExternalOptions.fVehicleInventory)
|
||||
{
|
||||
for(int x = 0; x<NUM_INV_SLOTS; x++)
|
||||
for (unsigned int i = 0; i < pInventoryPoolList.size(); i++)
|
||||
{
|
||||
if(vehicleInv[x] == FALSE)
|
||||
continue;
|
||||
if(pSoldier->inv[x].exists() == true)
|
||||
if (pInventoryPoolList[i].fExists == TRUE && (pInventoryPoolList[i].usFlags & WORLD_ITEM_REACHABLE))
|
||||
{
|
||||
if(pSoldier->inv[x].usItem != pInventoryPoolList[i].object.usItem)
|
||||
continue;
|
||||
else
|
||||
pInventoryPoolList[i].object.AddObjectsToStack(pSoldier->inv[x], -1, pSoldier, x);
|
||||
}
|
||||
else
|
||||
pInventoryPoolList[i].object.MoveThisObjectTo(pSoldier->inv[x], -1, pSoldier, x);
|
||||
if(pInventoryPoolList[i].object.ubNumberOfObjects < 0)
|
||||
{
|
||||
//RemoveItemFromWorld(i);
|
||||
break;
|
||||
for (int x = 0; x < NUM_INV_SLOTS; x++)
|
||||
{
|
||||
if (vehicleInv[x] == FALSE)
|
||||
continue;
|
||||
if (pSoldier->inv[x].exists() == true)
|
||||
{
|
||||
if (pSoldier->inv[x].usItem != pInventoryPoolList[i].object.usItem)
|
||||
continue;
|
||||
else
|
||||
pInventoryPoolList[i].object.AddObjectsToStack(pSoldier->inv[x], -1, pSoldier, x);
|
||||
}
|
||||
else
|
||||
pInventoryPoolList[i].object.MoveThisObjectTo(pSoldier->inv[x], -1, pSoldier, x);
|
||||
if (pInventoryPoolList[i].object.ubNumberOfObjects < 0)
|
||||
{
|
||||
//RemoveItemFromWorld(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
fTeamPanelDirty = TRUE;
|
||||
fMapPanelDirty = TRUE;
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
}
|
||||
}
|
||||
fTeamPanelDirty = TRUE;
|
||||
fMapPanelDirty = TRUE;
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
}
|
||||
// Flugente: also allow mercs to qickly pick up items this way (but not EPCs)
|
||||
else if ( !AM_AN_EPC(pSoldier) )
|
||||
{
|
||||
for (unsigned int i = 0; i < pInventoryPoolList.size(); ++i)
|
||||
{
|
||||
if (pInventoryPoolList[i].fExists == TRUE && (pInventoryPoolList[i].usFlags & WORLD_ITEM_REACHABLE))
|
||||
{
|
||||
INT8 invsize = (INT8)pSoldier->inv.size(); // remember inventorysize, so we don't call size() repeatedly
|
||||
for (INT8 bLoop = 0; bLoop < invsize; ++bLoop)
|
||||
{
|
||||
if ( CanItemFitInPosition( pSoldier, &pInventoryPoolList[i].object, bLoop, FALSE ) )
|
||||
{
|
||||
// TODO: do not add LBE if we would then have to move existing items
|
||||
|
||||
if (pSoldier->inv[bLoop].exists())
|
||||
{
|
||||
if (pSoldier->inv[bLoop].usItem != pInventoryPoolList[i].object.usItem)
|
||||
continue;
|
||||
else
|
||||
pInventoryPoolList[i].object.AddObjectsToStack(pSoldier->inv[bLoop], -1, pSoldier, bLoop, 0, FALSE);
|
||||
}
|
||||
else
|
||||
pInventoryPoolList[i].object.MoveThisObjectTo(pSoldier->inv[bLoop], -1, pSoldier, bLoop);
|
||||
|
||||
if (pInventoryPoolList[i].object.ubNumberOfObjects < 0)
|
||||
{
|
||||
//RemoveItemFromWorld(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
fTeamPanelDirty = TRUE;
|
||||
fMapPanelDirty = TRUE;
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user