Update player.tscript

This commit is contained in:
Sir-Skurpsalot 2026-05-12 23:22:30 -06:00 committed by GitHub
parent 11fd008515
commit dd438557d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,22 +7,26 @@ function PlayerData::damage(%this, %obj, %sourceObject, %position, %damage, %dam
if (%obj.healthFromMount) if (%obj.healthFromMount)
%rootObj = findRootObject(%obj); %rootObj = findRootObject(%obj);
%this.setDamageDirection(%rootObj, %sourceObject, %position);
if (%damageType !$= "Suicide") {
%getDamageLoc = %rootObj.getDamageLocation(%position);
%damageLoc = firstWord(%getDamageLoc);
}
%rootObj.applyDamage(%damage); %rootObj.applyDamage(%damage);
%this.onDamage(%rootObj, %damage); %this.onDamage(%rootObj, %damage);
%this.setDamageDirection(%rootObj, %sourceObject, %position);
// Deal with client callbacks here because we don't have this // Deal with client callbacks here because we don't have this
// information in the onDamage or onDisable methods // information in the onDamage or onDisable methods
%client = %rootObj.client; %client = %rootObj.client;
%sourceClient = %sourceObject ? %sourceObject.client : 0; %sourceClient = %sourceObject ? %sourceObject.client : 0;
%location = "Body";
if (isObject(%client)) if (isObject(%client))
{ {
if (%rootObj.getDamageState() !$= "Enabled") if (%rootObj.getDamageState() !$= "Enabled")
{ {
callGamemodeFunction("onDeath", %client, %sourceObject, %sourceClient, %damageType, %location); callGamemodeFunction("onDeath", %client, %sourceObject, %sourceClient, %damageType, %damageLoc);
} }
} }
} }