mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 16:42:41 +00:00
Sim: cross region boundaries; word mid-zone clears as region clears
Mirror runAutopilotWalk's multi-region auto-advance in the headless sim:
on a mid-zone stopComplete (active multi-region exp with a next region),
advanceToNextRegion and keep simulating instead of scoring a premature
"cleared". A transit error there is now recorded as halted, not cleared.
Also fix misleading run-complete wording: a non-boss region clear of a
multi-region zone now reads "Cleared {region}. The way to {next} opens
ahead." instead of "Cleared {zone}. Run complete." New midZoneRegionClear
helper shares finalizeExpeditionOnZoneClear's gating; the path is shared
with manual !region travel, so both autopilot and manual play get it.
(cherry picked from commit 5d2bba70849a0a3fdeac285cc55ea9b8fadea29c)
This commit is contained in:
@@ -363,6 +363,29 @@ func (s *SimRunner) RunExpedition(uid id.UserID, zoneID ZoneID, walkCap int) (*S
|
||||
res.Outcome = "tpk"
|
||||
i = walkCap // exit
|
||||
case stopComplete:
|
||||
// A stopComplete that reaches the sim is normally a full zone
|
||||
// clear (the walk auto-advances mid-zone region boundaries
|
||||
// internally). But a mid-zone region clear can still surface
|
||||
// here — e.g. the walk's auto-advance hit a transit error and
|
||||
// returned stopComplete. Mirror runAutopilotWalk: if the
|
||||
// expedition is still active in a multi-region zone with a
|
||||
// next region, cross into it and keep simulating instead of
|
||||
// scoring a premature "cleared".
|
||||
if fresh, ferr := getActiveExpedition(uid); ferr == nil && fresh != nil &&
|
||||
IsMultiRegionZone(fresh.ZoneID) {
|
||||
if cur, ok := CurrentRegion(fresh); ok {
|
||||
if next, ok := nextRegion(fresh.ZoneID, cur.ID); ok {
|
||||
if _, terr := s.P.advanceToNextRegion(uid, fresh, cur, next); terr != nil {
|
||||
res.Outcome = "halted"
|
||||
res.StopCode = "region_transit:" + terr.Error()
|
||||
i = walkCap
|
||||
break
|
||||
}
|
||||
exp = fresh
|
||||
break // continue the outer walk loop in the next region
|
||||
}
|
||||
}
|
||||
}
|
||||
res.Outcome = "cleared"
|
||||
i = walkCap
|
||||
case stopBoss, stopElite:
|
||||
|
||||
Reference in New Issue
Block a user