Skip to content

Commit ea97fb1

Browse files
committed
fix: fix entity leak
1 parent c73056e commit ea97fb1

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

CS2MenuManager/API/Class/Library.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,15 +142,15 @@ private static (float x, float y, float size) GetWorldTextPosition(CCSPlayerCont
142142

143143
public static void CreateFakeWorldText(this CCSPlayerController player, ScreenMenuInstance instance)
144144
{
145-
CPointWorldText? entity = CreateWorldText(" ", 35, Color.Orange, "Arial", false, 0f);
146-
if (entity == null) { instance.Close(false); return; }
147-
148145
CCSGOViewModel? viewModel = player.EnsureCustomView();
149146
if (viewModel == null) { instance.Close(false); return; }
150147

151148
VectorData? vectorData = player.FindVectorData();
152149
if (vectorData == null) { instance.Close(false); return; }
153150

151+
CPointWorldText? entity = CreateWorldText(" ", 35, Color.Orange, "Arial", false, 0f);
152+
if (entity == null) { instance.Close(false); return; }
153+
154154
entity.Teleport(vectorData.Value.Position, vectorData.Value.Angle, null);
155155
entity.AcceptInput("SetParent", viewModel, null, "!activator");
156156

CS2MenuManager/ProjectInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public static class ProjectInfo
88
/// <summary>
99
/// Gets the current version of the CS2MenuManager.
1010
/// </summary>
11-
public const string Version = "v31";
11+
public const string Version = "v32";
1212

1313
/// <summary>
1414
/// Gets the author of the CS2MenuManager.

0 commit comments

Comments
 (0)