Huhm. Quite a spectacularly old bug. I suppose Oremites and the more tolerant editor in TCB makes it easier to find now, but still a tricky one to track down, so well done on finding it. (But yes, you can see the bug in JtRH as well if you try)
The conditions only require this:
* The Slayer must be one square away from his target.
* The Slayer must be unable to kill his target this turn via any method.
At this point, the boolean bMovingWisp is set to check whether he can step on his target. This naturally fails due to the 2nd condition we set up, but the boolean isn't turned off, so for the rest of the turn, the Slayer uses Wisp conditions on what squares he can step on. Which means he can now step on monsters, and cause Bad Things(tm) to happen. The only 'difficulty' in seeing the bug after that is to force the Slayer to make a defensive move into a monster, but that's not too difficult.
One line fix though, so not difficult to correct this either: it just needs an extra "
this->
bMovingWisp = false"
in the Process subroutine of Slayer.cpp, in the following place:
if (this->wDistToTarget == 1)
{
//Step on target.
int dxFirst, dyFirst;
this->bMovingWisp = true; //need to set to step on target
if (GetDirectMovement(this->wTX, this->wTY, dxFirst, dyFirst, dx, dy))
if (this->wX + dx == this->wTX && this->wY + dy == this->wTY)
//if this move can successfully be made
{
this->bMovingWisp = false;
MakeStandardMove(CueEvents,dx,dy);
this->wSwordMovement = nGetO(dx,dy);
return;
}
this->bMovingWisp = false;
}
That should do the trick.
[Last edited by TFMurphy at 08-02-2007 03:21 AM]