devilutionX icon indicating copy to clipboard operation
devilutionX copied to clipboard

Ignore player damage if friendly fire game option off

Open DakkJaniels opened this issue 1 year ago • 4 comments

Add check for friendly fire game state in OnPlayerDamage

DakkJaniels avatar May 31 '24 21:05 DakkJaniels

Can you elaborate a bit on the overarching issue this resolves? Was friendly fire just bugged?

julealgon avatar May 31 '24 21:05 julealgon

You could only turn off yourself attacking players, not being attacked by players.

Trihedraf avatar May 31 '24 21:05 Trihedraf

I need to revert that last commit - the logic makes sense for the attacker in missiles.cpp, but I don't think it makes sense here, as that would allow someone to turn off receiving damage in a friendly fire game.

DakkJaniels avatar May 31 '24 21:05 DakkJaniels

Can you elaborate a bit on the overarching issue this resolves? Was friendly fire just bugged?

The settings menu friendly fire only effected missiles. You could hypothetically still attack someone with melee if you wanted to. By placing the check here, the settings menu setting also mitigates the possibility of someone using a modified game client to send bogus damage packets to players.

DakkJaniels avatar May 31 '24 21:05 DakkJaniels