Skip to content

Commit

Permalink
Play the correct sounds when we are getting attacked.
Browse files Browse the repository at this point in the history
Broken in f35de0d

NOTE: see aforementioned commit b18b76e
on why we should be spitting out warnings/errors, not ignore these issues.

Fixes ticket:3102
  • Loading branch information
vexed committed Feb 16, 2012
1 parent 9a66b4e commit 001ef35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions data/mp/multiplay/skirmish/rules.js
Expand Up @@ -224,18 +224,18 @@ function checkEndConditions()
// /////////////////////////////////////////////////////////////////
// WARNING MESSAGES
// Base Under Attack
function eventStructureAttacked(hitStruct, attackerObj)
function eventAttacked(victimObj, attackerObj)
{
if (gameTime > lastHitTime + 10)
{
lastHitTime = gameTime;
if (hitStruct)
if (victimObj.type == STRUCTURE)
{
playSound("pcv337.ogg", hitStruct.x, hitStruct.y, hitStruct.z); // show position if still alive
playSound("pcv337.ogg", victimObj.x, victimObj.y, victimObj.z); // show position if still alive
}
else
{
playSound("pcv337.ogg");
playSound("pcv399.ogg", victimObj.x, victimObj.y, victimObj.z);
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/cluster.cpp
Expand Up @@ -578,7 +578,8 @@ void clustObjectAttacked(BASE_OBJECT *psObj)
ASSERT(!"invalid object type", "clustObjectAttacked: invalid object type");
return;
}

// and fire the sound effect (and/or...) for the added callback trigger we just processed
triggerEventAttacked(psObj, g_pProjLastAttacker);
aClusterAttacked[psObj->cluster] = gameTime;
}
}
Expand Down

0 comments on commit 001ef35

Please sign in to comment.