diff --git a/binaries/data/mods/official/entities/template_structure_civic_civil_centre.xml b/binaries/data/mods/official/entities/template_structure_civic_civil_centre.xml
index d86173957d..3ae385ba6a 100644
--- a/binaries/data/mods/official/entities/template_structure_civic_civil_centre.xml
+++ b/binaries/data/mods/official/entities/template_structure_civic_civil_centre.xml
@@ -13,13 +13,15 @@
47
- Housing, Village
+ Housing, Village, CivilCentre
The heart of the player's empire. Trains economic units, and can only be built on settlements.
foundation_5x5
+
+ Settlement
24.0
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 bfc3f3bd45..6a008e9bbd 100644
--- a/binaries/data/mods/official/entities/template_structure_gaia_settlement.xml
+++ b/binaries/data/mods/official/entities/template_structure_gaia_settlement.xml
@@ -1,7 +1,7 @@
@@ -24,8 +24,6 @@
true
- foundation_5x5
-
24.0
24.0
diff --git a/binaries/data/mods/official/scripts/entity_functions.js b/binaries/data/mods/official/scripts/entity_functions.js
index 0ecaf5066d..fc6386f3a8 100644
--- a/binaries/data/mods/official/scripts/entity_functions.js
+++ b/binaries/data/mods/official/scripts/entity_functions.js
@@ -417,6 +417,11 @@ function attachAuras()
this.addAura ( "trample", a.radius, a.speed, new TrampleAura( this ) );
}
}
+
+ if( this.hasClass("Settlement") )
+ {
+ this.addAura ( "settlement", 0.1, 0, new SettlementAura( this ) );
+ }
}
// ====================================================================
@@ -1848,6 +1853,39 @@ function TrampleAura( source )
// ====================================================================
+function SettlementAura( source )
+{
+ // Defines the effects of the Settlement Aura. Changes ownership of entity when a civil center is on it.
+
+ this.source = source;
+
+ this.affects = function( e )
+ {
+ return ( e.hasClass("CivilCentre") );
+ }
+
+ this.onEnter = function( e )
+ {
+ if( this.affects( e ) )
+ {
+ // If a new Civ Centre has entered our radius, it must mean it's on us; switch player and become invisible
+ source.player = e.player;
+ source.visible = false;
+ }
+ };
+
+ this.onExit = function( e )
+ {
+ if( this.affects( e ) )
+ {
+ // If a Civ Centre has entered our radius, it must mean the one on us died; become visible again
+ source.visible = true;
+ }
+ }
+}
+
+// ====================================================================
+
function GotoInRange( x, y, run )
{
if ( !this.actions || !this.actions.move )