Merge remote-tracking branch 'upstream/development' into development

This commit is contained in:
marauder2k7 2026-05-16 14:11:05 +01:00
commit 86cb84efc8
2 changed files with 24 additions and 18 deletions

View file

@ -9,13 +9,6 @@ function DamageModel::onDestroy(%this)
//This is called when the server is initially set up by the game application
function DamageModel::initServer(%this)
{
}
//This is called when the server is created for an actual game/map to be played
function DamageModel::onCreateGameServer(%this)
{
%this.registerDatablock("./scripts/managedData/managedParticleData");
%this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
%this.queueExec("./scripts/server/utility");
%this.queueExec("./scripts/server/radiusDamage");
%this.queueExec("./scripts/server/projectile");
@ -26,6 +19,13 @@ function DamageModel::onCreateGameServer(%this)
%this.queueExec("./scripts/server/commands");
}
//This is called when the server is created for an actual game/map to be played
function DamageModel::onCreateGameServer(%this)
{
%this.registerDatablock("./scripts/managedData/managedParticleData");
%this.registerDatablock("./scripts/managedData/managedParticleEmitterData");
}
//This is called when the server is shut down due to the game/map being exited
function DamageModel::onDestroyGameServer(%this)
{

View file

@ -2,27 +2,33 @@ function PlayerData::damage(%this, %obj, %sourceObject, %position, %damage, %dam
{
if (!isObject(%obj) || %obj.getDamageState() !$= "Enabled" || !%damage)
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);
%rootObj.applyDamage(%damage);
%this.onDamage(%rootObj, %damage);
%getDamageLoc = %obj.getDamageLocation(%position);
%damageLoc = firstWord(%getDamageLoc);
}
%this.setDamageDirection(%rootObj, %sourceObject, %position);
%rootObj.applyDamage(%damage);
%rootObj.getDatablock().onDamage(%rootObj, %damage);
// Deal with client callbacks here because we don't have this
// information in the onDamage or onDisable methods
%client = %rootObj.client;
%sourceClient = %sourceObject ? %sourceObject.client : 0;
%location = "Body";
if (isObject(%client))
{
if (%rootObj.getDamageState() !$= "Enabled")
{
callGamemodeFunction("onDeath", %client, %sourceObject, %sourceClient, %damageType, %location);
callGamemodeFunction("onDeath", %client, %sourceObject, %sourceClient, %damageType, %damageLoc);
}
}
}
@ -30,7 +36,7 @@ function PlayerData::damage(%this, %obj, %sourceObject, %position, %damage, %dam
function PlayerData::onDamage(%this, %obj, %delta)
{
Parent::onDamage(%this, %obj, %delta);
// This method is invoked by the ShapeBase code whenever the
// object's damage level changes.
if (%delta > 0 && %obj.getDamageState() !$= "Destroyed")
@ -39,4 +45,4 @@ function PlayerData::onDamage(%this, %obj, %delta)
if (%delta > 10)
%obj.playPain();
}
}
}