Skip to content
Snippets Groups Projects
Commit 7ac3a5a6 authored by Chris Davidson's avatar Chris Davidson
Browse files

Disable self damage for player projectiles unless explicitly overridden with player_selffire

parent 47bb7854
No related branches found
No related tags found
No related merge requests found
......@@ -411,7 +411,13 @@ function _M:projectDoAct(typ, tg, damtype, dam, particles, px, py, tmp)
if not game.level.map:checkAllEntities(px, py, "projected", self, typ, px, py, damtype, dam, particles) then
-- Check self- and friendly-fire, and if the projection "misses"
local act = game.level.map(px, py, engine.Map.ACTOR)
if act and act == self and not ((type(typ.selffire) == "number" and rng.percent(typ.selffire)) or (type(typ.selffire) ~= "number" and typ.selffire)) then
if act and act == self and not (
((type(typ.selffire) == "number" and rng.percent(typ.selffire))
or
(type(typ.selffire) ~= "number" and typ.selffire))
and (act == game.player and typ.player_selffire) -- Disable friendlyfire for player projectiles unless explicitly overriden
)
then
elseif act and self.reactionToward and (self:reactionToward(act) >= 0) and not ((type(typ.friendlyfire) == "number" and rng.percent(typ.friendlyfire)) or (type(typ.friendlyfire) ~= "number" and typ.friendlyfire)) then
-- Otherwise hit
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment