mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
- New Feature: Rifle Sling (by Flugente)
o This attachment fits most ARs, Rifles and SMGs. When attached, moving the gun from the main hand to the rifle sling slot does not cost APs when 'Inventory Manipulation costs AP' is turned on. o When a merc would drop his gun because of damage taken, it is instead moved to the rifle sling slot if possible. o A gun in the main hand or rifle sling slot cannot be stolen when a rifle sling is attached. - Tripwire Feature Update (by Flugente) o proper pictures for tripwire (by smeagol) o Tripwire no longer activates diagonally. o When multiple bombs/tripwires are on a tile, only those activatable by tripwire get removed upon deflagged. - Scope Mode Feature Update (by Flugente) o Fixed a bug that would crash the game when displaying guns in inventory git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5207 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -3615,11 +3615,20 @@ BOOLEAN ActivateSurroundingTripwire( UINT8 ubID, INT32 sGridNo, INT8 bLevel )
|
||||
UINT32 uiTimeStamp= GetJA2Clock();
|
||||
BOOLEAN fFoundMine = FALSE;
|
||||
|
||||
// for every orientation
|
||||
for (UINT8 ort = NORTH; ort < NUM_WORLD_DIRECTIONS; ++ort)
|
||||
UINT8 feasibletripwiredirections[4] =
|
||||
{
|
||||
NORTH,
|
||||
EAST,
|
||||
SOUTH,
|
||||
WEST
|
||||
};
|
||||
|
||||
// for every orientation
|
||||
for (UINT8 i = 0; i < 4; ++i)
|
||||
{
|
||||
UINT8 direction = feasibletripwiredirections[i];
|
||||
// get adjacent grid
|
||||
UINT32 adjgrid = NewGridNo( sGridNo, DirectionInc( ort ) );
|
||||
UINT32 adjgrid = NewGridNo( sGridNo, DirectionInc( direction ) );
|
||||
|
||||
// if there is a bomb at that grid and level, and it isn't disabled
|
||||
for (UINT32 uiWorldBombIndex = 0; uiWorldBombIndex < guiNumWorldBombs; uiWorldBombIndex++)
|
||||
@@ -3640,13 +3649,17 @@ BOOLEAN ActivateSurroundingTripwire( UINT8 ubID, INT32 sGridNo, INT8 bLevel )
|
||||
|
||||
// this is important: delete the tripwire, otherwise we get into an infinite loop if there are two piecs of tripwire....
|
||||
RemoveItemFromPool( adjgrid, gWorldBombs[ uiWorldBombIndex ].iItemIndex, bLevel );
|
||||
|
||||
// make sure no one thinks there is a bomb here any more!
|
||||
if ( gpWorldLevelData[adjgrid].uiFlags & MAPELEMENT_PLAYER_MINE_PRESENT )
|
||||
|
||||
// if no other bomb exists here
|
||||
if ( FindWorldItemForBombInGridNo(adjgrid, bLevel) == -1 )
|
||||
{
|
||||
RemoveBlueFlag( adjgrid, bLevel );
|
||||
// make sure no one thinks there is a bomb here any more!
|
||||
if ( gpWorldLevelData[adjgrid].uiFlags & MAPELEMENT_PLAYER_MINE_PRESENT )
|
||||
{
|
||||
RemoveBlueFlag( adjgrid, bLevel );
|
||||
}
|
||||
gpWorldLevelData[adjgrid].uiFlags &= ~(MAPELEMENT_ENEMY_MINE_PRESENT);
|
||||
}
|
||||
gpWorldLevelData[adjgrid].uiFlags &= ~(MAPELEMENT_ENEMY_MINE_PRESENT);
|
||||
|
||||
// no add a tripwire item to the floor, simulating that activating tripwire deactivates it
|
||||
AddItemToPool( adjgrid, &newtripwireObject, 1, bLevel, 0, -1 );
|
||||
@@ -4008,13 +4021,17 @@ BOOLEAN SetOffBombsInGridNo( UINT8 ubID, INT32 sGridNo, BOOLEAN fAllBombs, INT8
|
||||
|
||||
// this is important: delete the tripwire, otherwise we get into an infinite loop if there are two piecs of tripwire....
|
||||
RemoveItemFromPool( sGridNo, gWorldBombs[ uiWorldBombIndex ].iItemIndex, bLevel );
|
||||
|
||||
// make sure no one thinks there is a bomb here any more!
|
||||
if ( gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_PLAYER_MINE_PRESENT )
|
||||
|
||||
// if no other bomb exists here
|
||||
if ( FindWorldItemForBombInGridNo(sGridNo, bLevel) == -1 )
|
||||
{
|
||||
RemoveBlueFlag( sGridNo, bLevel );
|
||||
// make sure no one thinks there is a bomb here any more!
|
||||
if ( gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_PLAYER_MINE_PRESENT )
|
||||
{
|
||||
RemoveBlueFlag( sGridNo, bLevel );
|
||||
}
|
||||
gpWorldLevelData[sGridNo].uiFlags &= ~(MAPELEMENT_ENEMY_MINE_PRESENT);
|
||||
}
|
||||
gpWorldLevelData[sGridNo].uiFlags &= ~(MAPELEMENT_ENEMY_MINE_PRESENT);
|
||||
|
||||
// no add a tripwire item to the floor, simulating that activating tripwire deactivates it
|
||||
AddItemToPool( sGridNo, &newtripwireObject, 1, bLevel, 0, -1 );
|
||||
|
||||
Reference in New Issue
Block a user