Fixed lag caused by character.damageLimb
This commit is contained in:
@@ -66,12 +66,3 @@ function(instance, p)
|
||||
return false
|
||||
end
|
||||
end, Hook.HookMethodType.Before)
|
||||
|
||||
Hook.Patch("Barotrauma.Character", "DamageLimb", function(instance, p)
|
||||
local result = Hook.Call("character.damageLimb", instance, p["afflictions"], p["attacker"], p["hitLimb"], p["worldPosition"], p["stun"], p["attackImpulse"], p["damageMultiplier"], p["allowStacking"], p["penetration"], p["shouldImplode"], p["playSound"])
|
||||
|
||||
if result == true then
|
||||
p.PreventExecution = true
|
||||
return false
|
||||
end
|
||||
end, Hook.HookMethodType.Before)
|
||||
|
||||
@@ -4468,6 +4468,12 @@ namespace Barotrauma
|
||||
{
|
||||
if (Removed) { return new AttackResult(); }
|
||||
|
||||
AttackResult? retAttackResult = GameMain.LuaCs.Hook.Call<AttackResult?>("character.damageLimb", this, worldPosition, hitLimb, afflictions, stun, playSound, attackImpulse, attacker, damageMultiplier, allowStacking, penetration, shouldImplode);
|
||||
if (retAttackResult != null)
|
||||
{
|
||||
return retAttackResult.Value;
|
||||
}
|
||||
|
||||
//character inside the sub received damage from a monster outside the sub
|
||||
//can happen during normal gameplay if someone for example fires a ranged weapon from outside,
|
||||
//the intention of this error message is to diagnose an issue with monsters being able to damage characters from outside
|
||||
|
||||
@@ -185,6 +185,9 @@ function character.applyAffliction(character, limbHealth, newAffliction, allowSt
|
||||
-- @realm shared
|
||||
function character.applyDamage(characterHealth, attackResult, hitLimb, allowStacking) end
|
||||
|
||||
--- Gets gets called every time a limb gets damaged by an attack.
|
||||
-- @realm shared
|
||||
function character.damageLimb(character, worldPosition, hitLimb, afflictions, stun, playSound, attackImpulse, attacker, damageMultiplier, allowStacking, penetration, shouldImplode) end
|
||||
|
||||
--- Gets called every time an affliction updates.
|
||||
-- @realm shared
|
||||
|
||||
Reference in New Issue
Block a user