From b5c884504c2ebee68804a614bc764a53ae565f6f Mon Sep 17 00:00:00 2001 From: Bassoonian Date: Fri, 11 Oct 2024 19:49:24 +0200 Subject: [PATCH] Fix negative mutation value (#5504) --- src/berry.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/berry.c b/src/berry.c index 9f187bd1e2..b1e29be6db 100644 --- a/src/berry.c +++ b/src/berry.c @@ -2384,6 +2384,8 @@ static u8 GetTreeMutationValue(u8 id) myMutation.asField.a = tree->mutationA; myMutation.asField.b = tree->mutationB; myMutation.asField.unused = 0; + if (myMutation.value == 0) // no mutation + return 0; return sBerryMutations[myMutation.value - 1][2]; #else return 0;