diff options
Diffstat (limited to 'internal/world/objects.go')
| -rw-r--r-- | internal/world/objects.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/world/objects.go b/internal/world/objects.go index 849c47a..fa17f08 100644 --- a/internal/world/objects.go +++ b/internal/world/objects.go @@ -308,6 +308,13 @@ func (w *World) TickObjWander() { if toRoom == st.RoomID { continue } + // A wander_rooms entry may point at a room that was since deleted. + // Moving there would strand the object in a nonexistent room, so + // leave it where it is. (roomPathIndex is read under w.mu, which + // this method already holds; LoadRoom would deadlock here.) + if _, ok := w.roomPathIndex[toRoom]; !ok { + continue + } moves = append(moves, struct { st *ObjState toRoom int |
