fix: gameStore.ts passes empty object to processCombatTick as first argument #29
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?
Severity: Critical
File:
src/lib/game/stores/gameStore.ts(line 199)Problem: The call
useCombatStore.getState().processCombatTick({}, rawMana, elements, ...)passes an empty object{}as the first argument. ThecombatStore.tswrapper at line 226 expects(rawMana, elements, maxMana, attackSpeedMult, onFloorCleared, onDamageDealt)— 6 parameters aftergetandsetare already bound. The{}becomesrawMana(a number),rawManabecomeselements(a record), etc. — all arguments are shifted.Impact: Combat tick processing receives completely wrong argument types.
rawManawill be{}(an object, not a number),elementswill be a number, etc. This will cause runtime errors or silent data corruption during combat.Fix: The call should be:
Remove the
{}first argument — the wrapper already bindsgetandsetinternally.Starting work on gameStore.ts passes empty object to processCombatTick
Fixed: Removed empty object
{}first argument from processCombatTick call in gameStore.ts. The wrapper already binds get/set internally.