cleanps for generalized PlayerData::damage with quick docs line for clarity in the future

This commit is contained in:
AzaezelX 2026-05-15 21:51:57 -05:00
parent 30ce3de8f0
commit 0e33b2c1d0

View file

@ -4,29 +4,20 @@ function PlayerData::damage(%this, %obj, %sourceObject, %position, %damage, %dam
return;
%rootObj = %obj;
if (%obj.healthFromMount)
%damageLoc = "";
//if we're not commiting sudoku, nor mounted and get our health there...
if (%damageType !$= "Suicide" && !(%obj.healthFromMount && isObject(%obj.getObjectMount())))
{
%rootObj = findRootObject(%obj);
%this.setDamageDirection(%rootObj, %sourceObject, %position);
}
else
{
%this.setDamageDirection(%obj, %sourceObject, %position);
}
%damageLoc = "body";
if (%damageType !$= "Suicide") {
%getDamageLoc = %obj.getDamageLocation(%position);
%this.setDamageDirection(%rootObj, %sourceObject, %position);
if (%damageType !$= "Suicide") {
%getDamageLoc = %rootObj.getDamageLocation(%position);
%damageLoc = firstWord(%getDamageLoc);
}
%this.setDamageDirection(%rootObj, %sourceObject, %position);
%rootObj.applyDamage(%damage);
%this.onDamage(%rootObj, %damage);
%rootObj.getDatablock().onDamage(%rootObj, %damage);
// Deal with client callbacks here because we don't have this
// information in the onDamage or onDisable methods