mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Added safety check
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8840 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+6
-2
@@ -7434,7 +7434,9 @@ void MoveBullet( INT32 iBullet )
|
||||
// Flugente: a riot shield would cover the entire front of a tile. We thus cannot check whether the person would be hit, as the bullet might miss a soldier
|
||||
// Instead, we check whether the structure is indeed a person, whether that person has a riot shield equipped, and whether that shield faces the bullet before it would hit the soldier
|
||||
// the same bullet cannot hit a shield multiple times
|
||||
if ( lastriotshieldholder != pStructure->usStructureID && pStructure->fFlags & STRUCTURE_PERSON )
|
||||
if ( lastriotshieldholder != pStructure->usStructureID
|
||||
&& pStructure->fFlags & STRUCTURE_PERSON
|
||||
&& pStructure->usStructureID < TOTAL_SOLDIERS )
|
||||
{
|
||||
SOLDIERTYPE* pTarget = MercPtrs[pStructure->usStructureID];
|
||||
|
||||
@@ -7651,7 +7653,9 @@ void MoveBullet( INT32 iBullet )
|
||||
|
||||
// Flugente: a riot shield would cover the entire front of a tile. We thus cannot check whether the person would be hit, as the bullet might miss a soldier
|
||||
// Instead, we check whether the structure is indeed a person, whether that person has a riot shield equipped, and whether that shield faces the bullet before it would hit the soldier
|
||||
if ( lastriotshieldholder != pStructure->usStructureID && pStructure->fFlags & STRUCTURE_PERSON )
|
||||
if ( lastriotshieldholder != pStructure->usStructureID
|
||||
&& pStructure->fFlags & STRUCTURE_PERSON
|
||||
&& pStructure->usStructureID < TOTAL_SOLDIERS )
|
||||
{
|
||||
SOLDIERTYPE* pTarget = MercPtrs[pStructure->usStructureID];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user