From ef8e67474a00f7e9885b445b25ef56bcee7f5ae0 Mon Sep 17 00:00:00 2001 From: cpojer Date: Tue, 29 Oct 2024 11:19:09 +0900 Subject: [PATCH] Allow `calculateLikelyDamage` to work for players that have not yet joined a map. GitOrigin-RevId: e2a3e313bb2790222c195e9e9cd9bbcef2d04920 --- athena/lib/calculateLikelyDamage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/athena/lib/calculateLikelyDamage.tsx b/athena/lib/calculateLikelyDamage.tsx index f356aee4..5935f5c9 100644 --- a/athena/lib/calculateLikelyDamage.tsx +++ b/athena/lib/calculateLikelyDamage.tsx @@ -39,7 +39,7 @@ export default function calculateLikelyDamage( ); return isUnit(entityB) && entityB.statusEffect === UnitStatusEffect.Poison && - map.getPlayer(unitA).activeSkills.has(Skill.BuyUnitAcidBomber) + map.maybeGetPlayer(unitA)?.activeSkills.has(Skill.BuyUnitAcidBomber) ? Math.floor(damage * (1 + PoisonSkillPowerDamageMultiplier)) : damage; }