Fixed a bug with units not dying during playtesting in the scenario editor.

This was SVN commit r4801.
This commit is contained in:
Matei 2007-01-20 18:35:02 +00:00
parent d618551fe8
commit 2c3c1be393

View File

@ -566,8 +566,10 @@ function performAttack( evt )
{
this.lastCombatTime = getGameTime();
var curr_hit = getGUIGlobal().newRandomSound("voice", "hit", this.traits.audio.path);
curr_hit.play();
if(getGUIGlobal().newRandomSound) {
var curr_hit = getGUIGlobal().newRandomSound("voice", "hit", this.traits.audio.path);
curr_hit.play();
}
// Attack logic.
var dmg = new DamageType();
@ -970,8 +972,11 @@ function damage( dmg, inflictor )
// Make him cry out in pain.
if (this.traits.audio && this.traits.audio.path)
{
curr_pain = getGUIGlobal().newRandomSound("voice", "pain", this.traits.audio.path);
if (curr_pain) curr_pain.play();
if(getGUIGlobal().newRandomSound) {
curr_pain = getGUIGlobal().newRandomSound(
"voice", "pain", this.traits.audio.path);
if (curr_pain) curr_pain.play();
}
}
else
{