mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-21 15:27:43 +01:00
fix: better handling for ORIG() calls in HOOK macro
This commit is contained in:
parent
90a0651458
commit
8851385c14
1 changed files with 12 additions and 7 deletions
|
|
@ -204,13 +204,18 @@ public class ScratchPlugin : IDalamudPlugin {
|
||||||
|
|
||||||
hookDetour +=
|
hookDetour +=
|
||||||
$"private {hook.RetType} Hook{i}Detour({hook.Arguments}) {{\n" +
|
$"private {hook.RetType} Hook{i}Detour({hook.Arguments}) {{\n" +
|
||||||
$"try {{\n" +
|
(!string.IsNullOrEmpty(originalCall) ? "try {\n" : string.Empty) +
|
||||||
$" {hook.Body}\n" +
|
$" {hook.Body}\n";
|
||||||
$"}} catch(Exception ex) {{\n" +
|
|
||||||
$" PluginLog.Error(ex, \"Exception in Hook{i}Detour!!\");\n" +
|
if (!string.IsNullOrEmpty(originalCall))
|
||||||
$"}}\n" +
|
{
|
||||||
$"{originalCall}" +
|
hookDetour += "} catch(Exception ex) {\n" +
|
||||||
$"\n}}\n";
|
$" PluginLog.Error(ex, \"Exception in Hook{i}Detour!!\");\n" +
|
||||||
|
"}\n" +
|
||||||
|
$"{originalCall}";
|
||||||
|
}
|
||||||
|
|
||||||
|
hookDetour += $"\n}}\n";
|
||||||
|
|
||||||
hookDispose += $"this.hook{i}Inst.Dispose();\n";
|
hookDispose += $"this.hook{i}Inst.Dispose();\n";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue