From d817856da16be8f91ebd816891afe43f56ec05f1 Mon Sep 17 00:00:00 2001 From: Graham Date: Mon, 17 Feb 2020 18:52:43 +0000 Subject: [PATCH] Remove counters with multiple increments --- .../dev/openrs2/deob/transform/CounterTransformer.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/deob/src/main/java/dev/openrs2/deob/transform/CounterTransformer.kt b/deob/src/main/java/dev/openrs2/deob/transform/CounterTransformer.kt index 6dc1d826b6..0f831d9c02 100644 --- a/deob/src/main/java/dev/openrs2/deob/transform/CounterTransformer.kt +++ b/deob/src/main/java/dev/openrs2/deob/transform/CounterTransformer.kt @@ -67,16 +67,13 @@ class CounterTransformer : Transformer() { increments: Map ) { for ((counter, value) in references) { - // one for the reset, two for the increment - if (value != 3) { - continue - } - if (resets[counter] != 1) { continue } - if (increments[counter] != 1) { + // one for the reset, two for each increment + val counterIncrements = increments[counter] ?: 0 + if (value != counterIncrements * 2 + 1) { continue }