From 0e60567a7a0addb9421769ee7be7853bfa8788cb Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Sat, 19 Sep 2026 03:15:59 -0400 Subject: refactor: simplifcation, change how rooms are stored in player yaml, remove legacy code --- internal/game/cmd_room_remove.go | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'internal/game/cmd_room_remove.go') diff --git a/internal/game/cmd_room_remove.go b/internal/game/cmd_room_remove.go index 77a09b3..361cc74 100644 --- a/internal/game/cmd_room_remove.go +++ b/internal/game/cmd_room_remove.go @@ -167,14 +167,7 @@ func (g *Game) roomRemove(sess *net.Session, args []string) { } // Apply: rewire A's dir exit to C, preserving A's current dir-exit props. - aRoom.Exits[dir] = world.ExitDef{ - Room: cID, - Condition: aExit.Condition, - BlockedMessage: aExit.BlockedMessage, - OnTraverse: aExit.OnTraverse, - Hidden: aExit.Hidden, - AlwaysBlocked: aExit.AlwaysBlocked, - } + aRoom.Exits[dir] = world.RewirePreserving(aExit, cID) aData, err := yaml.Marshal(aRoom) if err != nil { sess.WriteLine("Error updating current room YAML.") @@ -186,14 +179,7 @@ func (g *Game) roomRemove(sess *net.Session, args []string) { } // Rewire C's opposite exit to A, preserving C's current opposite-exit props. - cRoom.Exits[oppositeDir] = world.ExitDef{ - Room: aID, - Condition: cOppExit.Condition, - BlockedMessage: cOppExit.BlockedMessage, - OnTraverse: cOppExit.OnTraverse, - Hidden: cOppExit.Hidden, - AlwaysBlocked: cOppExit.AlwaysBlocked, - } + cRoom.Exits[oppositeDir] = world.RewirePreserving(cOppExit, aID) cPath, cPathOK := g.World.GetRoomPath(cID) if cPathOK { cData, cerr := yaml.Marshal(cRoom) @@ -218,6 +204,7 @@ func (g *Game) roomRemove(sess *net.Session, args []string) { g.World.RebuildRoomIndex(g.DataDir) g.MobStore.RemoveMobsInRoom(bID) g.World.ClearRoomState(bID) + g.clearGuardWatchRoom(bID) // Drop any cached in-room games and refund their outstanding wagers // before the room stops existing (same eviction semantics as the // admin editor's room deletion). -- cgit v1.2.3