aboutsummaryrefslogtreecommitdiff
path: root/internal/world
diff options
context:
space:
mode:
Diffstat (limited to 'internal/world')
-rw-r--r--internal/world/world.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/internal/world/world.go b/internal/world/world.go
index a554432..7768739 100644
--- a/internal/world/world.go
+++ b/internal/world/world.go
@@ -577,17 +577,18 @@ func (w *World) TickObjWander() {
continue
}
st.WanderCounter++
- if float64(st.WanderCounter) >= st.WanderInterval {
- st.WanderCounter = 0
- toRoom := st.WanderRooms[rand.Intn(len(st.WanderRooms))]
- if toRoom == st.RoomID {
- continue
- }
- moves = append(moves, struct {
- st *ObjState
- toRoom int
- }{st, toRoom})
+ if float64(st.WanderCounter) < st.WanderInterval {
+ continue
+ }
+ st.WanderCounter = 0
+ toRoom := st.WanderRooms[rand.Intn(len(st.WanderRooms))]
+ if toRoom == st.RoomID {
+ continue
}
+ moves = append(moves, struct {
+ st *ObjState
+ toRoom int
+ }{st, toRoom})
}
for _, m := range moves {
oldKey := w.objStateKey(m.st.RoomID, m.st.DefID, m.st.Index)