From d1404924d4d9aff71d5c9e3f3d75f36cbf1dc06e Mon Sep 17 00:00:00 2001 From: vk Date: Fri, 24 Sep 2021 18:01:05 -0700 Subject: [PATCH] fix infinite farming yield from evil turnips (and maybe others) Currently, a grown evil turnip has infinite yeild. This happens because of the return statemnt in the `else` calse of `chance` definition in `Patch.rollLivesDecrement()`. Because of the return, the method exists before `cropLives` is decremented. --- .../main/kotlin/rs09/game/node/entity/skill/farming/Patch.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Server/src/main/kotlin/rs09/game/node/entity/skill/farming/Patch.kt b/Server/src/main/kotlin/rs09/game/node/entity/skill/farming/Patch.kt index 13969e39e..3592b10e5 100644 --- a/Server/src/main/kotlin/rs09/game/node/entity/skill/farming/Patch.kt +++ b/Server/src/main/kotlin/rs09/game/node/entity/skill/farming/Patch.kt @@ -69,8 +69,9 @@ class Patch(val player: Player, val patch: FarmingPatch, var plantable: Plantabl PatchType.ALLOTMENT -> 8 //average of 8 per life times 3 lives = average 24 PatchType.HOPS -> 6 //average of 6 per life times 3 lives = 18 PatchType.BELLADONNA -> 2 //average of 2 per life times 3 lives = 6 + PatchType.EVIL_TURNIP -> 2 //average 2 per, same as BELLADONNA PatchType.CACTUS -> 3 //average of 3 per life times 3 lives = 9 - else -> return + else -> 0 // nothing should go here, but if it does, do not give extra crops amd decrement cropLives } if(magicSecateurs) chance += ceil(1.10 * chance).toInt() //will increase average yield by roughly 3.