Well, here's the function in question and my thoughts.
bool Behavior::ResumeScript(NPC *npc,EventManager *eventmgr)
{
npc->Printf("Resuming behavior %s at step %d.",name.GetData(),current_step);
if (current_step < sequence.Length())
{
if (sequence[current_step]->CompleteOperation(npc,eventmgr))
{
current_step++;
return RunScript(npc,eventmgr,false);
}
}
else
{
current_step=0;
return RunScript(npc,eventmgr,false);
}
}
You can see that there is case where no return value is sent ( ie the first if passes and nested if fails ). So the best way to solve this I think is to add a return true at the end. I am guessing true because RunScript() will return true if the behaviour is complete. So if there is nothing to do we can return true.