Bug: Equipment spell kills don't advance floor (1-tick delay) #226
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug Description
When an equipment spell delivers the killing blow to a floor, the floor advance logic doesn't run. The equipment spell loop just
breaks without:onFloorClearedcurrentFloorfloorHPto the new floor's maxcastProgressThe floor advance happens on the next tick when the primary spell loop sees
floorHP <= 0, causing a 1-tick delay.Code Location
src/lib/game/stores/combat-actions.tslines ~155-158 (equipment spell loop):Compare with the primary spell loop (lines ~107-117) which properly advances the floor and calls
onFloorCleared.Impact
Minor. Floor advancement is delayed by one tick when equipment spells deliver the killing blow. The
onFloorClearedcallback (which grants rewards) is also delayed. This creates an inconsistency between primary spell kills (instant) and equipment spell kills (delayed).Fix Required
Add the same floor-clear logic in the equipment spell loop as the primary spell loop: call
onFloorCleared, advancecurrentFloor, resetfloorHP, and resetcastProgress.Fixed: Equipment spell loop now includes floor-clear logic (onFloorCleared, floor advance, HP reset, castProgress reset) matching the primary spell loop.