From c29c2229369dfaae6b211520791fed44ba28316e Mon Sep 17 00:00:00 2001 From: Matei Date: Mon, 23 Jan 2006 10:36:18 +0000 Subject: [PATCH] Fixed a JS error message when corpses were attacked (because they had no armour). This was SVN commit r3418. --- .../data/mods/official/entities/template_entity_script.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/binaries/data/mods/official/entities/template_entity_script.js b/binaries/data/mods/official/entities/template_entity_script.js index 75dd4d1132..ad006318e1 100644 --- a/binaries/data/mods/official/entities/template_entity_script.js +++ b/binaries/data/mods/official/entities/template_entity_script.js @@ -470,8 +470,10 @@ function performHeal( evt ) function damage( dmg, inflictor ) { - this.last_combat_time = getGameTime(); + if(!this.traits.armour) return; // corpses have no armour, everything else should + this.last_combat_time = getGameTime(); + // Apply armour and work out how much damage we actually take crushDamage = parseInt(dmg.crush - this.traits.armour.value * this.traits.armour.crush); if ( crushDamage < 0 ) crushDamage = 0;