Inside the MoraleTools, in the body of FUNCTION RetreatToCover, I made a quick change that does the following ...
Note ... you must add in the declaration of int mult ;
Original Code
Code: Select all
//Log("Ret", GetUnitX(me), GetUnitY(me), bestX, bestY) ;
AddVizFunctionCall("SetRoute", me, bestX, bestY, 0 ) ;
//Log ("Retreat from x1, y1 to x2, y2", GetAttrib (me, "LastX"), GetAttrib (me, "LastY"), GetUnitX(me), GetUnitY(me)) ;
Change To Read
Code: Select all
//Log("Ret", GetUnitX(me), GetUnitY(me), bestX, bestY) ;
if ( GetAttrib(me, "ArmourType") != 1 )
{
AddVizFunctionCall("SetRoute", me, bestX, bestY, 0 ) ;
}
else
{
mult = GetAngleFromTile(bestX, bestY, me) ;
if( mult > 130 )
{
AddVizFunctionCall("SetRouteReverse", me, bestX, bestY, 0 ) ;
}
else
{
AddVizFunctionCall("SetRoute", me, bestX, bestY, 0 ) ;
}
}
//Log ("Retreat from x1, y1 to x2, y2", GetAttrib (me, "LastX"), GetAttrib (me, "LastY"), GetUnitX(me), GetUnitY(me)) ;

