From 0f812ccc307ea0550511ccced40b65dfb0cdaa91 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 18 Sep 2026 20:11:29 -0400 Subject: fix: world and casino integrity fixes --- internal/game/cmd_swapid.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'internal/game/cmd_swapid.go') diff --git a/internal/game/cmd_swapid.go b/internal/game/cmd_swapid.go index 8b637fb..d1dbd68 100644 --- a/internal/game/cmd_swapid.go +++ b/internal/game/cmd_swapid.go @@ -66,13 +66,15 @@ func (g *Game) executeSwapID(sess *net.Session, args []string, rawInput string) // Refuse while non-admin players are online: swapping room IDs relocates // every character whose state embeds those IDs, which is disruptive to // normal play. Admins may stay online (their own state is migrated too). - for _, other := range g.Hub.AllSessions() { - if other == sess || other.Player == nil { - continue - } - if !g.checkAdmin(other) { - sess.WriteLine("Cannot swap room IDs while non-admin players are online.") - return + if g.Hub != nil { + for _, other := range g.Hub.AllSessions() { + if other == sess || other.Player == nil { + continue + } + if !g.checkAdmin(other) { + sess.WriteLine("Cannot swap room IDs while non-admin players are online.") + return + } } } -- cgit v1.2.3