From: <fu...@us...> - 2009-07-01 13:11:24
|
Revision: 6667 http://gemrb.svn.sourceforge.net/gemrb/?rev=6667&view=rev Author: fuzzie Date: 2009-07-01 13:11:21 +0000 (Wed, 01 Jul 2009) Log Message: ----------- MoveNearerTo: account for PersonalDistance Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GSUtils.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GSUtils.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GSUtils.cpp 2009-06-30 21:29:09 UTC (rev 6666) +++ gemrb/trunk/gemrb/plugins/Core/GSUtils.cpp 2009-07-01 13:11:21 UTC (rev 6667) @@ -1661,7 +1661,16 @@ // maybe a future idea if we have a better implementation // (the old code used it - by passing true not 0 below - when target was a movable) GetPositionFromScriptable(target, p, 0); - MoveNearerTo(Sender, p, distance); + + // account for PersonalDistance (which caller uses, but pathfinder doesn't) + if (distance && Sender->Type == ST_ACTOR) { + distance += ((Actor *)Sender)->size*10; + } + if (distance && target->Type == ST_ACTOR) { + distance += ((Actor *)target)->size*10; + } + + MoveNearerTo(Sender, p, distance); } void MoveNearerTo(Scriptable *Sender, Point &p, int distance) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |