Index: binaries/data/mods/public/art/actors/structures/persians/stables.xml
===================================================================
--- binaries/data/mods/public/art/actors/structures/persians/stables.xml	(revision 13548)
+++ binaries/data/mods/public/art/actors/structures/persians/stables.xml	(working copy)
@@ -7,9 +7,9 @@
       <props>
         <prop actor="props/structures/decals/dirt_4x4.xml" attachpoint="root"/>
         <prop actor="props/structures/decals/celt_sb1_mud.xml" attachpoint="root"/>
-        <prop actor="props/structures/persians/stable_horse_a.xml" attachpoint="horsea"/>
-        <prop actor="props/structures/persians/stable_horse_b.xml" attachpoint="horseb"/>
-        <prop actor="props/structures/persians/stable_horse_c.xml" attachpoint="horsec"/>
+        <prop actor="props/structures/persians/stable_horse_a.xml" attachpoint="horsea" minheight="-20" maxheight="1.7"/>
+        <prop actor="props/structures/persians/stable_horse_b.xml" attachpoint="horseb" minheight="-20" maxheight="1.7"/>
+        <prop actor="props/structures/persians/stable_horse_c.xml" attachpoint="horsec" minheight="-20" maxheight="1.7"/>
       </props>
       <textures><texture file="structural/pers_struct.dds" name="baseTex"/></textures>
     </variant>
Index: source/graphics/Model.cpp
===================================================================
--- source/graphics/Model.cpp	(revision 13548)
+++ source/graphics/Model.cpp	(working copy)
@@ -36,11 +36,14 @@
 #include "ps/Profile.h"
 #include "ps/CLogger.h"
 #include "renderer/Renderer.h"
+#include "simulation2/Simulation2.h"
+#include "simulation2/components/ICmpTerrain.h"
 
+
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
 // Constructor
-CModel::CModel(CSkeletonAnimManager& skeletonAnimManager)
-	: m_Flags(0), m_Anim(NULL), m_AnimTime(0),
+CModel::CModel(CSkeletonAnimManager& skeletonAnimManager, CSimulation2& simulation)
+	: m_Flags(0), m_Anim(NULL), m_AnimTime(0), m_Simulation(simulation),
 	m_BoneMatrices(NULL),
 	m_AmmoPropPoint(NULL), m_AmmoLoadedProp(0),
 	m_SkeletonAnimManager(skeletonAnimManager)
@@ -380,7 +383,9 @@
 	{
 		const Prop& prop=m_Props[j];
 
-		CMatrix3D proptransform = prop.m_Point->m_Transform;;
+		CMatrix3D proptransform = prop.m_Point->m_Transform;
+
+		
 		if (prop.m_Point->m_BoneIndex != 0xff)
 		{
 			CMatrix3D boneMatrix = m_BoneMatrices[prop.m_Point->m_BoneIndex];
@@ -393,6 +398,26 @@
 			// not relative to any bone; just apply world-space transformation (i.e. relative to object-space origin)
 			proptransform.Concatenate(m_Transform);
 		}
+
+		// Adjust prop height to terrain level when needed
+		if (prop.m_maxHeight != 0.f || prop.m_minHeight != 0.f) 
+		{
+			CVector3D propTranslation = proptransform.GetTranslation();
+			CVector3D objTranslation = m_Transform.GetTranslation();
+			
+			CmpPtr<ICmpTerrain> cmpTerrain(m_Simulation, SYSTEM_ENTITY);
+			if (cmpTerrain)
+			{
+				float objTerrain = cmpTerrain->GetExactGroundLevel(objTranslation.X, objTranslation.Z);
+				float propTerrain = cmpTerrain->GetExactGroundLevel(propTranslation.X, propTranslation.Z);
+				float translateHeight = propTerrain - objTerrain;
+				translateHeight = fmax(translateHeight, prop.m_minHeight);
+				translateHeight = fmin(translateHeight, prop.m_maxHeight);
+				CMatrix3D translate = CMatrix3D();
+				translate.SetTranslation(0.f,translateHeight,0.f);
+				proptransform.Concatenate(translate);
+			}
+		}
 		
 		prop.m_Model->SetTransform(proptransform);
 		prop.m_Model->ValidatePosition();
@@ -484,7 +509,7 @@
 
 /////////////////////////////////////////////////////////////////////////////////////////////////////////////
 // AddProp: add a prop to the model on the given point
-void CModel::AddProp(const SPropPoint* point, CModelAbstract* model, CObjectEntry* objectentry)
+void CModel::AddProp(const SPropPoint* point, CModelAbstract* model, CObjectEntry* objectentry, float minHeight, float maxHeight)
 {
 	// position model according to prop point position
 
@@ -496,12 +521,14 @@
 	prop.m_Point = point;
 	prop.m_Model = model;
 	prop.m_ObjectEntry = objectentry;
+	prop.m_minHeight = minHeight;
+	prop.m_maxHeight = maxHeight;
 	m_Props.push_back(prop);
 }
 
 void CModel::AddAmmoProp(const SPropPoint* point, CModelAbstract* model, CObjectEntry* objectentry)
 {
-	AddProp(point, model, objectentry);
+	AddProp(point, model, objectentry, 0.f, 0.f);
 	m_AmmoPropPoint = point;
 	m_AmmoLoadedProp = m_Props.size() - 1;
 	m_Props[m_AmmoLoadedProp].m_Hidden = true;
@@ -564,7 +591,7 @@
 // Clone: return a clone of this model
 CModelAbstract* CModel::Clone() const
 {
-	CModel* clone = new CModel(m_SkeletonAnimManager);
+	CModel* clone = new CModel(m_SkeletonAnimManager,m_Simulation);
 	clone->m_ObjectBounds = m_ObjectBounds;
 	clone->InitModel(m_pModelDef);
 	clone->SetMaterial(m_Material);
@@ -577,7 +604,7 @@
 		if (m_AmmoPropPoint && i == m_AmmoLoadedProp)
 			clone->AddAmmoProp(m_Props[i].m_Point, m_Props[i].m_Model->Clone(), m_Props[i].m_ObjectEntry);
 		else
-			clone->AddProp(m_Props[i].m_Point, m_Props[i].m_Model->Clone(), m_Props[i].m_ObjectEntry);
+			clone->AddProp(m_Props[i].m_Point, m_Props[i].m_Model->Clone(), m_Props[i].m_ObjectEntry, m_Props[i].m_minHeight, m_Props[i].m_maxHeight);
 	}
 
 	return clone;
Index: source/graphics/Model.h
===================================================================
--- source/graphics/Model.h	(revision 13548)
+++ source/graphics/Model.h	(working copy)
@@ -35,6 +35,7 @@
 class CSkeletonAnim;
 class CSkeletonAnimDef;
 class CSkeletonAnimManager;
+class CSimulation2;
 
 #define MODELFLAG_CASTSHADOWS		(1<<0)
 #define MODELFLAG_NOLOOPANIMATION	(1<<1)
@@ -55,6 +56,9 @@
 	{
 		Prop() : m_Point(0), m_Model(0), m_ObjectEntry(0), m_Hidden(false) {}
 
+		float m_minHeight;
+		float m_maxHeight;
+
 		/**
 		 * Location of the prop point within its parent model, relative to either a bone in the parent model or to the 
 		 * parent model's origin. See the documentation for @ref SPropPoint for more details.
@@ -75,10 +79,11 @@
 
 public:
 	// constructor
-	CModel(CSkeletonAnimManager& skeletonAnimManager);
+	CModel(CSkeletonAnimManager& skeletonAnimManager, CSimulation2& simulation);
 	// destructor
 	~CModel();
 
+
 	/// Dynamic cast
 	virtual CModel* ToCModel()
 	{
@@ -205,7 +210,7 @@
 	/**
 	 * Add a prop to the model on the given point.
 	 */
-	void AddProp(const SPropPoint* point, CModelAbstract* model, CObjectEntry* objectentry);
+	void AddProp(const SPropPoint* point, CModelAbstract* model, CObjectEntry* objectentry, float minHeight, float maxHeight);
 
 	/**
 	 * Add a prop to the model on the given point, and treat it as the ammo prop.
@@ -250,6 +255,8 @@
 private:
 	// delete anything allocated by the model
 	void ReleaseData();
+	
+	CSimulation2& m_Simulation;
 
 	// object flags
 	int m_Flags;
Index: source/graphics/ObjectBase.cpp
===================================================================
--- source/graphics/ObjectBase.cpp	(revision 13548)
+++ source/graphics/ObjectBase.cpp	(working copy)
@@ -80,6 +80,8 @@
 	AT(angle);
 	AT(offsetx);
 	AT(offsetz);
+	AT(minheight);
+	AT(maxheight);
 	#undef AT
 	#undef EL
 
@@ -246,6 +248,10 @@
 									prop.m_PropPointName = pe.Value;
 								else if (pe.Name == at_actor)
 									prop.m_ModelName = pe.Value.FromUTF8();
+								else if (pe.Name == at_minheight)
+									prop.m_minHeight = pe.Value.ToFloat();
+								else if (pe.Name == at_maxheight)
+									prop.m_maxHeight = pe.Value.ToFloat();
 							}
 							currentVariant->m_Props.push_back(prop);
 						}
Index: source/graphics/ObjectBase.h
===================================================================
--- source/graphics/ObjectBase.h	(revision 13548)
+++ source/graphics/ObjectBase.h	(working copy)
@@ -59,6 +59,9 @@
 		CStr m_PropPointName;
 		// name of the model file - art/actors/props/sword.xml or whatever
 		CStrW m_ModelName;
+		// allow the prop to ajust the height from minHeight to maxHeight relative to the main model
+		float m_minHeight;
+		float m_maxHeight;
 	};
 	
 	struct Samp
Index: source/graphics/ObjectEntry.cpp
===================================================================
--- source/graphics/ObjectEntry.cpp	(revision 13548)
+++ source/graphics/ObjectEntry.cpp	(working copy)
@@ -35,11 +35,12 @@
 #include "ps/Game.h"
 #include "ps/World.h"
 #include "renderer/Renderer.h"
+#include "simulation2/Simulation2.h"
 
 #include <sstream>
 
-CObjectEntry::CObjectEntry(CObjectBase* base) :
-	m_Base(base), m_Color(1.0f, 1.0f, 1.0f, 1.0f), m_Model(NULL), m_Outdated(false)
+CObjectEntry::CObjectEntry(CObjectBase* base, CSimulation2& simulation) :
+	m_Base(base), m_Color(1.0f, 1.0f, 1.0f, 1.0f), m_Model(NULL), m_Outdated(false), m_Simulation(simulation)
 {
 }
 
@@ -123,7 +124,7 @@
 	}
 
 	// delete old model, create new 
-	CModel* model = new CModel(objectManager.GetSkeletonAnimManager());
+	CModel* model = new CModel(objectManager.GetSkeletonAnimManager(), m_Simulation);
 	delete m_Model;
 	m_Model = model;
 	model->SetMaterial(g_Renderer.GetMaterialManager().LoadMaterial(m_Base->m_Material));
@@ -234,7 +235,7 @@
 			if (isAmmo)
 				model->AddAmmoProp(proppoint, propmodel, oe);
 			else
-				model->AddProp(proppoint, propmodel, oe);
+				model->AddProp(proppoint, propmodel, oe, prop.m_minHeight, prop.m_maxHeight);
 			if (propmodel->ToCModel())
 				propmodel->ToCModel()->SetAnimation(oe->GetRandomAnimation("idle"));
 		}
Index: source/graphics/ObjectEntry.h
===================================================================
--- source/graphics/ObjectEntry.h	(revision 13548)
+++ source/graphics/ObjectEntry.h	(working copy)
@@ -22,6 +22,7 @@
 class CSkeletonAnim;
 class CObjectBase;
 class CObjectManager;
+class CSimulation2;
 struct SPropPoint;
 
 #include <map>
@@ -37,7 +38,7 @@
 class CObjectEntry
 {
 public:
-	CObjectEntry(CObjectBase* base);
+	CObjectEntry(CObjectBase* base, CSimulation2& simulation);
 	~CObjectEntry();
 
 	// Construct this actor, using the specified variation selections
@@ -75,6 +76,8 @@
 	bool m_Outdated;
 
 private:
+	CSimulation2& m_Simulation;
+
 	typedef std::multimap<CStr, CSkeletonAnim*> SkeletonAnimMap;
 	SkeletonAnimMap m_Animations;
 		// TODO: something more memory-efficient than storing loads of similar strings for each unit?
Index: source/graphics/ObjectManager.cpp
===================================================================
--- source/graphics/ObjectManager.cpp	(revision 13548)
+++ source/graphics/ObjectManager.cpp	(working copy)
@@ -139,7 +139,7 @@
 	// makes more sense (e.g. use shared_ptr); for now I'll just leak, to avoid making the logic
 	// more complex than it is already is, since this only matters for the rare case of hotloading.
 
-	CObjectEntry* obj = new CObjectEntry(base); // TODO: type ?
+	CObjectEntry* obj = new CObjectEntry(base, m_Simulation); // TODO: type ?
 
 	// TODO (for some efficiency): use the pre-calculated choices for this object,
 	// which has already worked out what to do for props, instead of passing the
