Corrected customDeathReason in OnPlayerDamage

Previously it was called for absolutely any damage from the player.
This commit is contained in:
Zoom L1 2021-12-02 22:13:25 +07:00 committed by GitHub
parent ce056f1ce5
commit 77ded28826
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2250,7 +2250,7 @@ namespace TShockAPI
* If the player was not specified, that is, the player index is -1, then it is definitely a custom cause, as you can only deal damage with a projectile or another player.
* This is how everything else works. If an NPC is specified, its value is not -1, which is a custom cause.
*/
if (TShock.Config.Settings.DisableCustomDeathMessages &&
if (TShock.Config.Settings.DisableCustomDeathMessages && id != args.Player.Index &&
(reason._sourcePlayerIndex == -1 || reason._sourceNPCIndex != -1 || reason._sourceOtherIndex != -1 || reason._sourceCustomReason != null))
{
TShock.Log.ConsoleDebug("Bouncer / OnPlayerDamage rejected custom death message from {0}", args.Player.Name);