Skip to content

Commit

Permalink
Skip dead objects when applying splash and incendary damage.
Browse files Browse the repository at this point in the history
Fixes an assertion due to re-destroying dead structures.

Introduced in 4657de6.
  • Loading branch information
Cyp committed Jan 29, 2012
1 parent cbb6a05 commit 1a08636
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/projectile.cpp
Expand Up @@ -1187,6 +1187,11 @@ static void proj_ImpactFunc( PROJECTILE *psObj )
gridStartIterate(psObj->pos.x, psObj->pos.y, psStats->radius);
for (BASE_OBJECT *psCurr = gridIterate(); psCurr != NULL; psCurr = gridIterate())
{
if (psCurr->died)
{
continue; // Do not damage dead objects further.
}

if (psCurr == psObj->psDest)
{
continue; // Don't hit main target twice.
Expand Down Expand Up @@ -1366,6 +1371,11 @@ static void proj_checkBurnDamage(PROJECTILE *psProj)
gridStartIterate(psProj->pos.x, psProj->pos.y, psStats->incenRadius);
for (BASE_OBJECT *psCurr = gridIterate(); psCurr != NULL; psCurr = gridIterate())
{
if (psCurr->died)
{
continue; // Do not damage dead objects further.
}

if (aiCheckAlliances(psProj->player, psCurr->player))
{
continue; // Don't damage your own droids, nor ally droids - unrealistic, but better.
Expand Down

0 comments on commit 1a08636

Please sign in to comment.