mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Minor change: when aiming a weapon in prone stance, this also counts as 'mounting' the weapon. This allows redefining 'mounting' as 'weapon is readied an leaning on a physical object, which can be a structure, person or floor'
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7808 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -14373,15 +14373,7 @@ BOOLEAN SOLDIERTYPE::IsWeaponMounted( void )
|
||||
// we must be in a sector (not travelling)
|
||||
if ( !bInSector )
|
||||
return(FALSE);
|
||||
|
||||
// not possible if already prone
|
||||
if ( gAnimControl[this->usAnimState].ubEndHeight == ANIM_PRONE )
|
||||
return(FALSE);
|
||||
|
||||
// not possible to get this bonus on a roof, as there are no objects on the roof on which we could rest our gun
|
||||
if ( this->pathing.bLevel == 1 )
|
||||
return(FALSE);
|
||||
|
||||
|
||||
// this is odd - invalid GridNo... well, not mounted then
|
||||
if ( TileIsOutOfBounds( this->sGridNo ) )
|
||||
return(FALSE);
|
||||
@@ -14399,6 +14391,14 @@ BOOLEAN SOLDIERTYPE::IsWeaponMounted( void )
|
||||
else if ( !WeaponReady( this ) )
|
||||
return FALSE;
|
||||
|
||||
// if we are prone, then we are 'mounting' our gun on the very floor we are laying upon, which always exist
|
||||
if ( gAnimControl[this->usAnimState].ubEndHeight == ANIM_PRONE )
|
||||
return TRUE;
|
||||
|
||||
// not possible to get this bonus on a roof, as there are no objects on the roof on which we could rest our gun
|
||||
if ( this->pathing.bLevel == 1 )
|
||||
return(FALSE);
|
||||
|
||||
// we determine the height of the next tile in our direction. Because of the way structures are handled, we sometimes have to take the very tile we're occupying right now
|
||||
INT32 nextGridNoinSight = this->sGridNo;
|
||||
if ( this->ubDirection == NORTH || this->ubDirection == SOUTHWEST || this->ubDirection == WEST || this->ubDirection == NORTHWEST )
|
||||
|
||||
Reference in New Issue
Block a user