aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_move.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/cmd_move.go')
-rw-r--r--internal/game/cmd_move.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/internal/game/cmd_move.go b/internal/game/cmd_move.go
index 576bdd5..761db2f 100644
--- a/internal/game/cmd_move.go
+++ b/internal/game/cmd_move.go
@@ -79,16 +79,23 @@ func (g *Game) doMove(sess *net.Session, dir string, isWalk bool) {
g.cancelAction(p)
}
- ticks := g.moveTicks(p, isWalk)
+ ticks, usesEnergy := g.moveTicks(p, isWalk)
p.MoveDirection = string(exitDir)
p.MoveTarget = targetID
if ticks <= 0 {
+ // Instant-move gear (Cape of Agility, GodMode): escape the miss-gate
+ // entirely. Stash the usesEnergy flag so completeMove drains if due.
+ p.MoveUsesEnergy = usesEnergy
g.completeMove(sess, p)
return
}
if inCombat {
+ // Defer the move: stash it in the Escape* fields and wait for a mob
+ // miss, mob death, or the 3-strike "power through" relief. Do NOT set
+ // MoveUsesEnergy here — no move is in flight yet, and beginEscapeMove
+ // recomputes (and stores) the flag when the gate fires.
firstEscape := p.EscapeDir == ""
p.EscapeDir = string(exitDir)
p.EscapeTarget = targetID
@@ -111,6 +118,7 @@ func (g *Game) doMove(sess *net.Session, dir string, isWalk bool) {
return
}
+ p.MoveUsesEnergy = usesEnergy
p.MoveTicks = ticks
}