mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 14:23:40 +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 +=
|
||||
$"private {hook.RetType} Hook{i}Detour({hook.Arguments}) {{\n" +
|
||||
$"try {{\n" +
|
||||
$" {hook.Body}\n" +
|
||||
$"}} catch(Exception ex) {{\n" +
|
||||
$" PluginLog.Error(ex, \"Exception in Hook{i}Detour!!\");\n" +
|
||||
$"}}\n" +
|
||||
$"{originalCall}" +
|
||||
$"\n}}\n";
|
||||
(!string.IsNullOrEmpty(originalCall) ? "try {\n" : string.Empty) +
|
||||
$" {hook.Body}\n";
|
||||
|
||||
if (!string.IsNullOrEmpty(originalCall))
|
||||
{
|
||||
hookDetour += "} catch(Exception ex) {\n" +
|
||||
$" PluginLog.Error(ex, \"Exception in Hook{i}Detour!!\");\n" +
|
||||
"}\n" +
|
||||
$"{originalCall}";
|
||||
}
|
||||
|
||||
hookDetour += $"\n}}\n";
|
||||
|
||||
hookDispose += $"this.hook{i}Inst.Dispose();\n";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue