Fix character.death hook getting called a billion times per second
This commit is contained in:
+1
-1
@@ -205,7 +205,7 @@ internal class HarmonyEventPatchesService : ISystem
|
|||||||
_eventService.PublishEvent<IEventCharacterCreated>(x => x.OnCharacterCreated(__result));
|
_eventService.PublishEvent<IEventCharacterCreated>(x => x.OnCharacterCreated(__result));
|
||||||
}
|
}
|
||||||
|
|
||||||
[HarmonyPatch(typeof(Character), nameof(Character.Kill)), HarmonyPostfix]
|
[HarmonyPatch(typeof(Character), "KillProjSpecific"), HarmonyPostfix]
|
||||||
public static void Character_Kill_Post(Character __instance, Affliction causeOfDeathAffliction, CauseOfDeathType causeOfDeath)
|
public static void Character_Kill_Post(Character __instance, Affliction causeOfDeathAffliction, CauseOfDeathType causeOfDeath)
|
||||||
{
|
{
|
||||||
_eventService.PublishEvent<IEventCharacterDeath>(x => x.OnCharacterDeath(__instance, causeOfDeathAffliction, causeOfDeath));
|
_eventService.PublishEvent<IEventCharacterDeath>(x => x.OnCharacterDeath(__instance, causeOfDeathAffliction, causeOfDeath));
|
||||||
|
|||||||
@@ -412,6 +412,7 @@ class LuaScriptManagementService : ILuaScriptManagementService, ILuaDataService,
|
|||||||
|
|
||||||
_script.Globals["ExecutionNumber"] = 0;
|
_script.Globals["ExecutionNumber"] = 0;
|
||||||
_script.Globals["CSActive"] = !enableSandbox;
|
_script.Globals["CSActive"] = !enableSandbox;
|
||||||
|
((Table)_script.Globals["debug"])["breakpoint"] = () => { Debugger.Break(); };
|
||||||
|
|
||||||
_script.Globals["SERVER"] = LuaCsSetup.IsServer;
|
_script.Globals["SERVER"] = LuaCsSetup.IsServer;
|
||||||
_script.Globals["CLIENT"] = LuaCsSetup.IsClient;
|
_script.Globals["CLIENT"] = LuaCsSetup.IsClient;
|
||||||
|
|||||||
Reference in New Issue
Block a user