mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-05-19 04:06:37 +00:00
Merge pull request #1740 from Azaezel/damagemodelTypofix
cleanps for generalized PlayerData::damage with quick docs line for c…
This commit is contained in:
commit
26ff1b8dfe
1 changed files with 7 additions and 16 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue