Vanilla commit:
589791e9f9
This was being falsely triggered before because the distance (3m) was
far too small and it was only counting fast moving vehicles. The player
can be damaged up to 25m away from the vehicle explosion.
The comment was incorrect. It can be easily checked by using the
included diag_log at the top of this file.
Most of the time the source will be local (zombie) or player (physics).
The next most common will be getting shot by a remote player, the least
common will be getting shot by a remote vehicle.
If you kill a player zombie you should not lose humanity. Player_death
is now synced with the humanity hit code in the damage handler.
Also the killing blow set variable was moved up because the same
conditions were already checked above.
In the initialize section of the fsm r_player_unconscious and
r_player_timeout return their default values (false and 0). Also, the
Vanilla server-side combat check doesn't appear to work, or it doesn't
work with the antihack disabled (I haven't tested with it enabled).
New variable inCombat is set more quickly than the combatTimeout
variable
When localizing vanilla strings please do not put "EPOCH" in their name
or include them in the dayz_epoch package of the stringtable. This
creates more work to backport common translation updates and vice versa.
MPHit does not always fire when a player is killed:
https://community.bistudio.com/wiki/ArmA_2:_Event_Handlers#MPHit
Using either MPHit or MPKilled is not a good idea here. There is already
a local 'killed' event handler which fires on player death
(player_death.sqf). That script sends a PV (priority message) to the
server which triggers server_playerDied. That means fnc_plyrHit needed
to finish sending its data to the server via public setVariables
(non-priority messages) before server_playerDied executed. Triggering
both these scripts at the same time was a bad idea.
Instead of sending the data to the server via setVariable I just
included it in PVDZ_plr_Death. This also lets us pass extra information
from the damage handler like ammo type, cause of death, etc. Still need
to test, but it should be more reliable and performant than
fnc_playerHit called from MPHit or MPKilled.
Prevents loss of humanity from shooting player zombies and bandits. Adds
a cap to humanity loss per shot depending on the players murders, where
the cap is zero. This preventing the shooter from getting positive
humanity, which could be exploited to farm humanity using 2 players.