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:
Flugente
2015-04-03 20:14:30 +00:00
parent 98ff352eb0
commit 591682d493
2 changed files with 18 additions and 18 deletions
+9 -9
View File
@@ -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 )