Skip to content

Commit

Permalink
clear up aliveHealers also on UnitCreated, not only on UnitDestroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
Damgam committed May 18, 2024
1 parent 87d5341 commit 41ff037
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions luarules/gadgets/pve_areahealers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,21 @@ end

function gadget:UnitCreated(unitID, unitDefID, unitTeam)
if healersTable[unitDefID] then
Spring.Echo("Created Area Healer", unitID, UnitDefs[unitDefID].name)
aliveHealers[unitID] = {
healingpower = healersTable[unitDefID].healingpower,
healingrange = healersTable[unitDefID].healingrange,
canbehealed = healersTable[unitDefID].canbehealed,
}
else
aliveHealers[unitID] = nil
end
end

function gadget:UnitDestroyed(unitID, unitDefID, unitTeam, attackerID)
--if aliveHealers[unitID] then
if aliveHealers[unitID] then
aliveHealers[unitID] = nil
--end
end
end

function gadget:GameFrame(frame)
Expand Down

0 comments on commit 41ff037

Please sign in to comment.