|
I think I have found another "run off into the sunset" bug. I have not spent much time looking at this part of the code, so there is a possibility I'm missing something - but I'm getting the following in the log when I run off into the sunset:
RunToNextLoc() - Using CurLocPoint: 1
6/23/2006 6:07:12 PM: ** Entering RunToLoc(-1, -1, -1, -1, True, 0, -1, True, False) - MIN DISTANCE: 7.8
This occurs when RANDOMRUNMODE= RUNAROUND
I think the cause is here:
In TargetMonster:
if NOT ExitLoop then
' If we didn't target anything valid - move on!
if (RandomRunMode <> g_SAMESPOT) then
<deleted>
SendEscape()
RunToNextLoc()
This brings us to:
if (RandomRunMode = g_CLOSESTSCON or RandomRunMode = g_ROAMAROUND) then
<deleted>
else
Do While(TRUE)
ContinueOn=FALSE
if(CurLocPoint=0) then
objDebug.Print "RunToNextLoc() - Using STARTING Loc Point", 1
StatusBar2("RunToNextLoc() - Using STARTING Loc Point")
Call RunToLoc(StartingLocPoint.GetX(), StartingLocPoint.GetY(), StartingLocPoint.GetDir(), -1, FALSE, 0, -1, FALSE, FALSE)
else
objDebug.Print "RunToNextLoc() - Using CurLocPoint: " & CurLocPoint, 1
'StatusBar2("RunToNextLoc() - Using CurLocPoint: " & CurLocPoint)
Call RunToLoc(LocPoints(CurLocPoint).GetX(), LocPoints(CurLocPoint).GetY(), LocPoints(CurLocPoint).GetDir(), -1, TRUE, 0, -1, TRUE, FALSE)
The above "else" is where we are calling RunToLoc with -1s. I think that we haven't assigned LocPoints yet (at least, I can't find it, but I haven't looked really hard. For other modes, such as closest con, we call
SetClosestsMonsterLocPoints() to assign them, but I can't see where we do it for this.
Since I basically just want a CLOSESTCON that doesn't return to the start point , I worked around this changing the first if to:
if (RandomRunMode = g_CLOSESTSCON or RandomRunMode = g_ROAMAROUND)
but you will probably want to make the right fix.
Hope this helps.
|