aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_move.go
diff options
context:
space:
mode:
authorhistoria <[not public]>2026-06-21 22:19:17 -0400
committerhistoria <[not public]>2026-06-21 22:19:17 -0400
commita3ae1e6aad696f584d138d9363c05dedff136a65 (patch)
tree81e615f7227bc9d1ec79ceefc7311ecde917b074 /internal/game/cmd_move.go
parent84072ffe6365ad57c4976e9272762aa6db41de7e (diff)
downloadthehouseoficarus-a3ae1e6aad696f584d138d9363c05dedff136a65.tar.gz
feat: safespot system implemented
Diffstat (limited to 'internal/game/cmd_move.go')
-rw-r--r--internal/game/cmd_move.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/game/cmd_move.go b/internal/game/cmd_move.go
index f921a81..a5f1690 100644
--- a/internal/game/cmd_move.go
+++ b/internal/game/cmd_move.go
@@ -117,6 +117,14 @@ func (g *Game) completeMove(sess *net.Session, p *player.Player) {
p.Action = nil
+ g.safespotMu.Lock()
+ if ss, ok := g.safespotStates[p.Name]; ok {
+ g.safespotMu.Unlock()
+ g.forceLeaveSafespot(sess, p, ss, "")
+ } else {
+ g.safespotMu.Unlock()
+ }
+
oldRoom := p.RoomID
p.RoomID = targetID
p.Stats.RecordRoomVisit(targetID)