mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
- prisoners give information only on mobile patrols, not on city sectors
- if using militia equipment, items stolen by militia are dropped after combat if their class is distributed to militia by the player - Fix: do not delete world items with invalid gridno - Fix: militia drop gear on valid GridNo git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5892 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -2086,6 +2086,35 @@ void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGr
|
||||
// Make copy of item
|
||||
gTempObject = gWorldItems[ pItemPool->iItemIndex ].object;
|
||||
|
||||
// Flugente: if we allow militia to use sector equipment, then mark gear they pick up, so that they drop it too.
|
||||
if ( pSoldier->bTeam == MILITIA_TEAM && gGameExternalOptions.fMilitiaUseSectorInventory )
|
||||
{
|
||||
if ( Item[gTempObject.usItem].usItemClass & IC_ARMOUR && gGameExternalOptions.fMilitiaUseSectorInventory_Armour )
|
||||
{
|
||||
gTempObject[0]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
}
|
||||
else if ( Item[gTempObject.usItem].usItemClass & IC_FACE && gGameExternalOptions.fMilitiaUseSectorInventory_Face )
|
||||
{
|
||||
gTempObject[0]->data.sObjectFlag |= IC_FACE;
|
||||
}
|
||||
else if ( Item[gTempObject.usItem].usItemClass & (IC_BLADE|IC_PUNCH) && gGameExternalOptions.fMilitiaUseSectorInventory_Melee )
|
||||
{
|
||||
gTempObject[0]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
}
|
||||
else if ( Item[gTempObject.usItem].usItemClass & IC_GRENADE && gGameExternalOptions.fMilitiaUseSectorInventory_Grenade )
|
||||
{
|
||||
gTempObject[0]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
}
|
||||
else if ( Item[gTempObject.usItem].usItemClass & (IC_GUN|IC_AMMO) && gGameExternalOptions.fMilitiaUseSectorInventory_Gun )
|
||||
{
|
||||
gTempObject[0]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
}
|
||||
else if ( Item[gTempObject.usItem].usItemClass & IC_LAUNCHER && gGameExternalOptions.fMilitiaUseSectorInventory_Launcher )
|
||||
{
|
||||
gTempObject[0]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !AutoPlaceObject( pSoldier, &gTempObject, TRUE ) )
|
||||
{
|
||||
// check to see if the object has been swapped with one in inventory
|
||||
@@ -2211,6 +2240,35 @@ void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGr
|
||||
*/
|
||||
RemoveItemFromPool( sGridNo, iItemIndex, pSoldier->pathing.bLevel );
|
||||
|
||||
// Flugente: if we allow militia to use sector equipment, then mark gear they pick up, so that they drop it too.
|
||||
if ( pSoldier->bTeam == MILITIA_TEAM && gGameExternalOptions.fMilitiaUseSectorInventory )
|
||||
{
|
||||
if ( Item[gWorldItems[ iItemIndex ].object.usItem].usItemClass & IC_ARMOUR && gGameExternalOptions.fMilitiaUseSectorInventory_Armour )
|
||||
{
|
||||
gWorldItems[ iItemIndex ].object[0]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
}
|
||||
else if ( Item[gWorldItems[ iItemIndex ].object.usItem].usItemClass & IC_FACE && gGameExternalOptions.fMilitiaUseSectorInventory_Face )
|
||||
{
|
||||
gWorldItems[ iItemIndex ].object[0]->data.sObjectFlag |= IC_FACE;
|
||||
}
|
||||
else if ( Item[gWorldItems[ iItemIndex ].object.usItem].usItemClass & (IC_BLADE|IC_PUNCH) && gGameExternalOptions.fMilitiaUseSectorInventory_Melee )
|
||||
{
|
||||
gWorldItems[ iItemIndex ].object[0]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
}
|
||||
else if ( Item[gWorldItems[ iItemIndex ].object.usItem].usItemClass & IC_GRENADE && gGameExternalOptions.fMilitiaUseSectorInventory_Grenade )
|
||||
{
|
||||
gWorldItems[ iItemIndex ].object[0]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
}
|
||||
else if ( Item[gWorldItems[ iItemIndex ].object.usItem].usItemClass & (IC_GUN|IC_AMMO) && gGameExternalOptions.fMilitiaUseSectorInventory_Gun )
|
||||
{
|
||||
gWorldItems[ iItemIndex ].object[0]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
}
|
||||
else if ( Item[gWorldItems[ iItemIndex ].object.usItem].usItemClass & IC_LAUNCHER && gGameExternalOptions.fMilitiaUseSectorInventory_Launcher )
|
||||
{
|
||||
gWorldItems[ iItemIndex ].object[0]->data.sObjectFlag |= TAKEN_BY_MILITIA;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !AutoPlaceObject( pSoldier, &(gWorldItems[ iItemIndex ].object ), TRUE ) )
|
||||
{
|
||||
//ADB well we made an animation, should we still use up points?
|
||||
|
||||
Reference in New Issue
Block a user