Skip to content

Commit 923058b

Browse files
committed
Update vfx manager
1 parent 012d95d commit 923058b

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

ECommons/ECommons.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
44
<Authors>NightmareXIV</Authors>
5-
<BaseVersion>3.1.0.11</BaseVersion>
5+
<BaseVersion>3.1.0.12</BaseVersion>
66
<PackageKind></PackageKind>
77
<VersionSuffix Condition="'$(PackageKind)' != ''">-$(PackageKind)</VersionSuffix>
88
<Version>$(BaseVersion)$(VersionSuffix)</Version>

ECommons/GameHelpers/VfxManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private static bool TryGetVfx(ulong? objectID, string? pathSearch, out List<VfxI
170170
/// <see cref="Init" /> to track created VFXs.
171171
/// </summary>
172172
/// <seealso cref="ActorVfx.ActorVfxCreateCallbackDelegate" />
173-
private static unsafe void TrackOnVfxCreate(nint vfxPtr, Utf8String* vfxPathPtr, nint casterAddress, nint targetAddress, float a4, byte a5, ushort a6, byte a7)
173+
private static unsafe void TrackOnVfxCreate(nint vfxPtr, nint vfxPathPtr, nint casterAddress, nint targetAddress, float a4, byte a5, ushort a6, byte a7)
174174
{
175175
var vfx = (VfxStruct*)vfxPtr;
176176
var vfxID = vfxPtr.ToInt64();
@@ -187,7 +187,7 @@ private static unsafe void TrackOnVfxCreate(nint vfxPtr, Utf8String* vfxPathPtr,
187187

188188
casterID = casterObject?.GameObjectId ?? ulong.MaxValue;
189189
targetID = targetObject?.GameObjectId ?? ulong.MaxValue;
190-
path = vfxPathPtr->ToString();
190+
path = MemoryHelper.ReadString(new nint(vfxPathPtr), Encoding.ASCII, 256);
191191
}
192192
catch(Exception ex)
193193
{

ECommons/Hooks/ActorVfx.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ public static unsafe class ActorVfx
2828
/// Can be cast to a <see cref="ECommons.GameHelpers.VfxStruct" />.
2929
/// </param>
3030
/// <param name="vfxPathPtr">
31-
/// Pointer to the VFX path string.<br />Call <see cref="Utf8String.ToString"/>() on it.
31+
/// Pointer to the VFX path string.<br />
32+
/// Can resolve to a string with
33+
/// <see
34+
/// cref="Dalamud.Memory.MemoryHelper.ReadString(nint, System.Text.Encoding, int)">
35+
/// MemoryHelper.ReadString((nint)vfxPathPtr, Encoding.ASCII, 256)
36+
/// </see>
3237
/// .
3338
/// </param>
3439
/// <param name="casterAddress">Address of the caster GameObject.</param>
@@ -42,7 +47,7 @@ public static unsafe class ActorVfx
4247
/// These delegates are called after that is already done (to provide
4348
/// <paramref name="vfxPtr" />).
4449
/// </remarks>
45-
public delegate void ActorVfxCreateCallbackDelegate(nint vfxPtr, Utf8String* vfxPathPtr, nint casterAddress, nint targetAddress, float a4, byte a5, ushort a6, byte a7);
50+
public delegate void ActorVfxCreateCallbackDelegate(nint vfxPtr, nint vfxPathPtr, nint casterAddress, nint targetAddress, float a4, byte a5, ushort a6, byte a7);
4651

4752
/// <summary>
4853
/// The signature your method must match to subscribe to
@@ -114,7 +119,7 @@ internal static nint ActorVfxCreateDetour(nint a1, nint a2, nint a3, float a4, b
114119
try
115120
{
116121
var subscriberMethod = (ActorVfxCreateCallbackDelegate)subscriber;
117-
subscriberMethod(output, (Utf8String*)a1, a2, a3, a4, a5, a6, a7);
122+
subscriberMethod(output, a1, a2, a3, a4, a5, a6, a7);
118123
}
119124
catch(Exception e)
120125
{

0 commit comments

Comments
 (0)