From 2162a773fa499bfa1e1c46ca44c3cef81a14a30f Mon Sep 17 00:00:00 2001 From: Curtis Woodard Date: Tue, 12 Nov 2019 18:06:20 -0700 Subject: [PATCH] [FIX] TileCondition functionality Problem: `TileCondition` (used by `QueueTask.waitTile(Tile)` does not work correctly. Symptom: `Tile` properties that are used in `Tile.sameAs(Tile)` are `val` thus cannot be changed. When a tile was passed to `TileCondition` as `src`. It seems as though the intention was for `src` to update as a reference the properties update, but the properties will never update, thus rendering `TileCondition` useless. Solution: `TileCondition` now takes `Pawn` and `Tile`, and since `Pawn.tile` is a `var` it means that it changes as `Pawn.tile` changes, and it allows `TileCondition` to work as expected. `QueueTask.waitTile(tile: Tile)` has been changed to `QueueTask.waitTile(tile: Tile, pawn: Pawn = ctx as Pawn)` --- .../kotlin/gg/rsmod/game/model/queue/QueueTask.kt | 4 ++-- .../model/queue/coroutine/SuspendableCondition.kt | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/game/src/main/kotlin/gg/rsmod/game/model/queue/QueueTask.kt b/game/src/main/kotlin/gg/rsmod/game/model/queue/QueueTask.kt index 09dae77c8b..0f0f693c5a 100644 --- a/game/src/main/kotlin/gg/rsmod/game/model/queue/QueueTask.kt +++ b/game/src/main/kotlin/gg/rsmod/game/model/queue/QueueTask.kt @@ -102,8 +102,8 @@ data class QueueTask(val ctx: Any, val priority: TaskPriority) : Continuation