Here is a version of mine:
function Combat:DoAreaAttack(target, range, weapon, validfn, stimuli, excludetags)
local hitcount = 0
local x, y, z = target.Transform:GetWorldPosition()
local ents = TheSim:FindEntities(x, y, z, range, nil, excludetags
or {"falling", "FX", "NOCLICK", "DECOR", "INLIMBO", "notarget", "invisible", "noattack"})
for i, ent in ipairs(ents) do
if ent.components.combat and ent ~= target and ent ~= self.inst and self:CanAreaHitTarget(ent)
and (not validfn or validfn(ent)) then
self.inst:PushEvent("onareaattackother", {target = ent, weapon = weapon, stimuli = stimuli})
ent.components.combat:GetAttacked(self.inst, self:CalcDamage(ent, weapon, self.areahitdamagepercent),
weapon, stimuli)
hitcount = hitcount + 1
end
end
return hitcount
end
Steps to Reproduce
Look at components/combat.lua and find DoAreaAttack pushing wrong event with target=target, rather than target=ent
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now