aboutsummaryrefslogtreecommitdiff
path: root/internal/game/cmd_room_remove.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/game/cmd_room_remove.go')
-rw-r--r--internal/game/cmd_room_remove.go19
1 files changed, 3 insertions, 16 deletions
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).