From: <fu...@us...> - 2009-01-28 20:19:36
|
Revision: 5563 http://gemrb.svn.sourceforge.net/gemrb/?rev=5563&view=rev Author: fuzzie Date: 2009-01-28 20:19:33 +0000 (Wed, 28 Jan 2009) Log Message: ----------- check for a relevant target_mode before relying on the value of spellCount 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-01-28 19:23:23 UTC (rev 5562) +++ gemrb/trunk/gemrb/plugins/Core/GameControl.cpp 2009-01-28 20:19:33 UTC (rev 5563) @@ -1302,7 +1302,7 @@ { char Tmp[256]; - if (spellCount) { + if ((target_mode&TARGET_MODE_CAST) && spellCount) { //we'll get the container back from the coordinates TryToCast(actor, container->Pos); return; @@ -1329,7 +1329,7 @@ { char Tmp[256]; - if (spellCount) { + if ((target_mode&TARGET_MODE_CAST) && spellCount) { //we'll get the door back from the coordinates TryToCast(actor, door->Pos); return; @@ -1360,7 +1360,7 @@ bool GameControl::HandleActiveRegion(InfoPoint *trap, Actor * actor, Point &p) { - if (spellCount) { + if ((target_mode&TARGET_MODE_CAST) && spellCount) { //we'll get the active region from the coordinates (if needed) TryToCast(actor, p); //don't bother with this region further @@ -1509,7 +1509,7 @@ //just a single actor, no formation if (game->selected.size()==1) { //the player is using an item or spell on the ground - if (spellCount) { + if ((target_mode&TARGET_MODE_CAST) && spellCount) { TryToCast(core->GetFirstSelectedPC(false), p); return; } @@ -1574,7 +1574,7 @@ //we shouldn't zero this for two reasons in case of spell or item //1. there could be multiple targets //2. the target mode is important - if (!spellCount) { + if (!(target_mode&TARGET_MODE_CAST) || !spellCount) { target_mode = TARGET_MODE_NONE; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |