diff --git a/binaries/data/mods/official/entities/template_structure_gaia_settlement.xml b/binaries/data/mods/official/entities/template_structure_gaia_settlement.xml index 09303a6164..606a0b5818 100644 --- a/binaries/data/mods/official/entities/template_structure_gaia_settlement.xml +++ b/binaries/data/mods/official/entities/template_structure_gaia_settlement.xml @@ -8,7 +8,7 @@ - Gaia Building + Settlement Settlement Gaia @@ -37,6 +37,6 @@ true - + - \ No newline at end of file + diff --git a/binaries/data/mods/official/scripts/entity_functions.js b/binaries/data/mods/official/scripts/entity_functions.js index c2db6344d5..24c981f9fd 100644 --- a/binaries/data/mods/official/scripts/entity_functions.js +++ b/binaries/data/mods/official/scripts/entity_functions.js @@ -858,7 +858,10 @@ function performRepair( evt ) function damage( dmg, inflictor ) { var arm = this.traits.armour; - if(!arm) return; // corpses have no armour, everything else should + if( !arm ) return; // corpses have no armour, everything else should + + // Use traits.health.max = 0 to signify immortal things like settlements + if( this.traits.health.max == 0 ) return; this.lastCombatTime = getGameTime(); @@ -944,10 +947,13 @@ function damage( dmg, inflictor ) } // Notify player. - if ( inflictor ) - console.write( this.traits.id.generic + " got the point of " + inflictor.traits.id.generic + "'s weapon." ); - else - console.write( this.traits.id.generic + " died in mysterious circumstances." ); + if ( inflictor ) { + console.write( "P" + this.player.id + "'s " + this.traits.id.generic + + " got the point of " + inflictor.traits.id.generic + "'s weapon." ); + } else { + console.write( "P" + this.player.id + "'s " + this.traits.id.generic + + " died in mysterious circumstances." ); + } // Make him cry out in pain. if (this.traits.audio && this.traits.audio.path) @@ -1052,7 +1058,7 @@ function entityEventNotification( evt ) function getAttackAction( target ) { - if (!this.actions.attack) + if ( !this.actions.attack || target.traits.health.max == 0 ) return ACTION_NONE; var attack = this.actions.attack; if ( attack.melee ) @@ -2216,4 +2222,4 @@ function getBuildingLimit( category/*, gameMode*/ ) if(category=="Special") return 1; return 0; -} \ No newline at end of file +}