Merge pull request #1740 from Azaezel/damagemodelTypofix

cleanps for generalized PlayerData::damage with quick docs line for c…
This commit is contained in:
Brian Roberts 2026-05-15 21:53:13 -05:00 committed by GitHub
commit 26ff1b8dfe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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