Skip to content

Commit

Permalink
Fix an issue where poison was applied again on a reload.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 68c84ef13fc6f7634702b9f73c810330b8a02b8a
  • Loading branch information
cpojer committed Aug 6, 2024
1 parent b29169f commit 55f1e5d
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions hera/lib/addEndTurnAnimations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ export default function addEndTurnAnimations(
onComplete: (state) => {
requestFrame(async () => {
const { map, vision } = state;
const newMap = applyBeginTurnStatusEffects(
subtractFuel(map, nextPlayer),
nextPlayer,
);
const newMap = isFake
? map
: applyBeginTurnStatusEffects(
subtractFuel(map, nextPlayer),
nextPlayer,
);
const [unitsToHeal, unitsToRefill] = isFake
? [emptyUnitMap, emptyUnitMap]
: partitionUnitsToHeal(
Expand All @@ -72,12 +74,14 @@ export default function addEndTurnAnimations(
),
);

const poisonedUnits = map.units.filter(
(unit, vector) =>
!unitsToHeal.has(vector) &&
isPoisoned(map, nextPlayer, unit) &&
vision.isVisible(map, vector),
);
const poisonedUnits = isFake
? emptyUnitMap
: map.units.filter(
(unit, vector) =>
!unitsToHeal.has(vector) &&
isPoisoned(map, nextPlayer, unit) &&
vision.isVisible(map, vector),
);
const extraPositions = await maybeExtraPositions;
const unitsToSupply = new Map([
...(isFake
Expand Down

0 comments on commit 55f1e5d

Please sign in to comment.