mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-23 17:09:17 +01:00
fix: use potentially modified toast message
This commit is contained in:
parent
5845af4fe3
commit
94d642d1b5
1 changed files with 18 additions and 4 deletions
|
|
@ -125,10 +125,24 @@ namespace Dalamud.Game.Internal.Gui
|
||||||
|
|
||||||
this.OnToast?.Invoke(ref str, ref isHandled);
|
this.OnToast?.Invoke(ref str, ref isHandled);
|
||||||
|
|
||||||
// do nothing if handled or show the toast
|
// do nothing if handled
|
||||||
return isHandled
|
if (isHandled)
|
||||||
? IntPtr.Zero
|
{
|
||||||
: this.showToastHook.Original(manager, text, layer, bool1, bool2, logMessageId);
|
return IntPtr.Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
var encoded = str.Encode();
|
||||||
|
var terminated = new byte[encoded.Length + 1];
|
||||||
|
Array.Copy(encoded, 0, terminated, 0, encoded.Length);
|
||||||
|
terminated[^1] = 0;
|
||||||
|
|
||||||
|
unsafe
|
||||||
|
{
|
||||||
|
fixed (byte* message = terminated)
|
||||||
|
{
|
||||||
|
return this.showToastHook.Original(manager, (IntPtr)message, layer, bool1, bool2, logMessageId);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue