From e5f9d2903d818b884b8ebfe79487cbcd2c0ca0cd Mon Sep 17 00:00:00 2001 From: Shane McGovern Date: Sun, 2 Aug 2026 23:22:34 +0100 Subject: [PATCH] Fix revived Pokemon not receiving experience share When a Pokemon faints in battle, onFaint() clears it from the battle participant set. The revive item restored HP but never re-added the mon to self.participants, so at awardExp() time the revived mon passed the HP check but failed the participant gate -- getting no exp. Fix: re-add the revived mon to battle.participants in the revive item effect, so it's counted as a participant and receives its share of experience at battle end. Fixes #648 --- src/inventory/ItemEffects.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/inventory/ItemEffects.lua b/src/inventory/ItemEffects.lua index d60e16a3..ad1e2165 100644 --- a/src/inventory/ItemEffects.lua +++ b/src/inventory/ItemEffects.lua @@ -324,6 +324,11 @@ function ItemEffects.use(data, save, itemId, target, battle, moveIndex, ow) require("src.core.Sound").play(data, "Heal_HP") -- a revive takes the same .healHP -> .doneHealing route, animating up -- from the fainted mon's 0 HP (#252) + -- re-add to participants so the revived mon gets its share of exp + -- at battle end (onFaint clears the flag; revive must restore it) + if battle and battle.participants then + battle.participants[target] = true + end return "consumed", { Strings("%s\nis revitalized!", monName(data, target)) }, { healedFrom = 0 } end