Index: binaries/data/mods/public/simulation/components/GarrisonHolder.js
===================================================================
--- binaries/data/mods/public/simulation/components/GarrisonHolder.js	(revision 11240)
+++ binaries/data/mods/public/simulation/components/GarrisonHolder.js	(working copy)
@@ -1,21 +1,26 @@
 function GarrisonHolder() {}
 
 GarrisonHolder.prototype.Schema =
-	"<element name='Max'>" +
+	"<element name='Max' a:help='Maximum number of entities which can be garrisoned inside this holder'>" +
 		"<data type='positiveInteger'/>" +
 	"</element>" +
-	"<element name='List'>" +
+	"<element name='List' a:help='Classes of entities which are allowed to garrison inside this holder (from Identity)'>" +
 		"<attribute name='datatype'>" +
 			"<value>tokens</value>" +
 		"</attribute>" +
 		"<text/>" +
 	"</element>" +
-	"<element name='EjectHealth'>" +
+	"<element name='EjectHealth' a:help='Percentage of maximum health below which point this entity no longer allows garrisoning'>" +
 		"<ref name='nonNegativeDecimal'/>" +
 	"</element>" + 
-	"<element name='BuffHeal'>" +
+	"<element name='BuffHeal' a:help='How many hit points will be restored every second'>" +
 		"<data type='positiveInteger'/>" +
-	"</element>";
+	"</element>" +
+	"<optional>" +
+		"<element name='LoadingRange' a:help='The maximum distance from this garrison holder at which entities are allowed to garrison (should be at least 2 since entities cannot move directly onto the garrison holder)'>" +
+			"<ref name='nonNegativeDecimal'/>" +
+		"</element>" +
+	"</optional>";
 
 /**
  * Initialize GarrisonHolder Component
@@ -30,6 +35,15 @@
 };
 
 /**
+ * Return range at which entities can garrison here
+ */
+GarrisonHolder.prototype.GetLoadingRange = function()
+{
+	var max = +(this.template.LoadingRange || 2);
+	return { "max": max, "min": 0 };
+};
+
+/**
  * Return the list of entities garrisoned inside
  */
 GarrisonHolder.prototype.GetEntities = function()
Index: binaries/data/mods/public/simulation/components/UnitAI.js
===================================================================
--- binaries/data/mods/public/simulation/components/UnitAI.js	(revision 11241)
+++ binaries/data/mods/public/simulation/components/UnitAI.js	(working copy)
@@ -366,9 +366,7 @@
 		}
 		else
 		{
-			// TODO: this is probably bogus if the unit was
-			// unable to move at all - we need to do some range checks
-			// before actually garrisoning
+			// We do a range check before actually garrisoning
 			this.StopMoving();
 			this.SetNextState("INDIVIDUAL.GARRISON.GARRISONED");
 		}
@@ -1198,7 +1196,7 @@
 					var target = this.order.data.target;
 					// Check that we can still garrison here and that garrisoning succeeds
 					var cmpGarrisonHolder = Engine.QueryInterface(target, IID_GarrisonHolder);
-					if (this.CanGarrison(target) && cmpGarrisonHolder.Garrison(this.entity))
+					if (this.CanGarrison(target) && this.CheckGarrisonRange(target) && cmpGarrisonHolder.Garrison(this.entity))
 					{
 						this.isGarrisoned = true;
 					}
@@ -1972,6 +1970,15 @@
 	return cmpUnitMotion.IsInTargetRange(target, range.min, range.max);
 };
 
+UnitAI.prototype.CheckGarrisonRange = function(target)
+{
+	var cmpGarrisonHolder = Engine.QueryInterface(target, IID_GarrisonHolder);
+	var range = cmpGarrisonHolder.GetLoadingRange();
+
+	var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
+	return cmpUnitMotion.IsInTargetRange(target, range.min, range.max);
+}
+
 /**
  * Returns true if the target entity is visible through the FoW/SoD.
  */
@@ -2407,7 +2414,9 @@
 	this.SetHeldPosition(pos.x, pos.z);
 
 	this.SetStance(stance);
-	if (stance == "stand" || stance == "defensive" || stance == "passive")
+	// Stop moving if switching to stand ground
+	// TODO: Also stop existing orders in a sensible way
+	if (stance == "stand")
 		this.StopMoving();
 
 	// Reset the range query, since the range depends on stance
Index: binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_bireme.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_bireme.xml	(revision 11240)
+++ binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_bireme.xml	(working copy)
@@ -33,6 +33,7 @@
     <EjectHealth>0</EjectHealth>
     <List datatype="tokens">Support Infantry Cavalry</List>
     <BuffHeal>1</BuffHeal>
+    <LoadingRange>10</LoadingRange>
   </GarrisonHolder>
   <Health>
     <Max>800</Max>
Index: binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_fishing.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_fishing.xml	(revision 11240)
+++ binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_fishing.xml	(working copy)
@@ -23,6 +23,7 @@
     <EjectHealth>0</EjectHealth>
     <List datatype="tokens">Support Infantry</List>
     <BuffHeal>1</BuffHeal>
+    <LoadingRange>10</LoadingRange>
   </GarrisonHolder>
   <Identity>
     <GenericName>Fishing Boat</GenericName>
Index: binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_merchant.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_merchant.xml	(revision 11240)
+++ binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_merchant.xml	(working copy)
@@ -16,6 +16,7 @@
     <EjectHealth>0</EjectHealth>
     <List datatype="tokens">Support Infantry Cavalry</List>
     <BuffHeal>1</BuffHeal>
+    <LoadingRange>10</LoadingRange>
   </GarrisonHolder>
   <Health>
     <Max>400</Max>
Index: binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_quinquereme.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_quinquereme.xml	(revision 11240)
+++ binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_quinquereme.xml	(working copy)
@@ -33,6 +33,7 @@
     <EjectHealth>0</EjectHealth>
     <List datatype="tokens">Support Infantry Cavalry Siege</List>
     <BuffHeal>1</BuffHeal>
+    <LoadingRange>10</LoadingRange>
   </GarrisonHolder>
   <Health>
     <Max>2000</Max>
Index: binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_trireme.xml
===================================================================
--- binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_trireme.xml	(revision 11240)
+++ binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_trireme.xml	(working copy)
@@ -37,6 +37,7 @@
     <EjectHealth>0</EjectHealth>
     <List datatype="tokens">Support Infantry Cavalry Siege</List>
     <BuffHeal>1</BuffHeal>
+    <LoadingRange>10</LoadingRange>
   </GarrisonHolder>
   <Health>
     <Max>1400</Max>
