From: <ze...@us...> - 2009-03-29 17:36:04
|
Revision: 5838 http://gemrb.svn.sourceforge.net/gemrb/?rev=5838&view=rev Author: zefklop Date: 2009-03-29 17:36:00 +0000 (Sun, 29 Mar 2009) Log Message: ----------- Do not adjust position if there is no need to do so... Modified Paths: -------------- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp Modified: gemrb/trunk/gemrb/plugins/Core/GameControl.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-03-29 17:13:40 UTC (rev 5837) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-03-29 17:36:00 UTC (rev 5838) @@ -198,17 +198,21 @@ p.x += (int)newx; p.y += (int)newy; - p.x/=16; - p.y/=12; + if (p.x < 0) p.x = 8; + if (p.y < 0) p.y = 8; + if (p.x > map->GetWidth()*16) p.x = map->GetWidth()*16 - 8; + if (p.y > map->GetHeight()*12) p.y = map->GetHeight()*12 - 8; - if (p.x < 0) p.x = 0; - if (p.y < 0) p.y = 0; - if (p.x > map->GetWidth()) p.x = map->GetWidth(); - if (p.y > map->GetHeight()) p.y = map->GetHeight(); - - map->AdjustPosition(p) ; + if(map->GetCursor(p) == IE_CURSOR_BLOCKED) { + //we can't get there --> adjust position + p.x/=16; + p.y/=12; + map->AdjustPosition(p); + p.x*=16; + p.y*=12; + } // generate an action to do the actual movement - sprintf( Tmp, "MoveToPoint([%d.%d])", p.x*16, p.y*12 ); + sprintf( Tmp, "MoveToPoint([%d.%d])", p.x, p.y ); actor->AddAction( GenerateAction( Tmp) ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |