From: <Kha...@us...> - 2010-02-06 21:48:03
|
Revision: 5462 http://planeshift.svn.sourceforge.net/planeshift/?rev=5462&view=rev Author: Khakilord Date: 2010-02-06 21:47:56 +0000 (Sat, 06 Feb 2010) Log Message: ----------- Fixed an infinite loop in some cases when resuming NPC behaviour scripts. Modified Paths: -------------- trunk/src/npcclient/npcbehave.cpp Modified: trunk/src/npcclient/npcbehave.cpp =================================================================== --- trunk/src/npcclient/npcbehave.cpp 2010-02-06 19:26:11 UTC (rev 5461) +++ trunk/src/npcclient/npcbehave.cpp 2010-02-06 21:47:56 UTC (rev 5462) @@ -737,6 +737,9 @@ bool Behavior::RunScript(NPC *npc, EventManager *eventmgr, bool interrupted) { size_t start_step = current_step; + // Without this, we will get an infinite loop. + if (start_step >= sequence.GetSize()) + start_step = 0; while (true) { if (current_step < sequence.GetSize() ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |