Fix errors in PrivateLobbyPatch and ChatCommandsPatch

This commit is contained in:
DeveloperNyx committed 2026-03-16 17:53:07 +00:00
1 parent ae8d53372d
commit caa1caa646
2 files changed
+10 -5

No files matched your search

+6 -4
View File
@@ -126,9 +126,11 @@ internal static class PrivateLobbyPatch
button.enabled = false;
// Change inactive sprite to cyan color to indicate locked state
var sprite = __instance.HostPrivateButton.transform.Find("Inactive").GetComponent<SpriteRenderer>();
sprite?.color = new(0.35f, 1, 1, 1);
var sprite = __instance.HostPrivateButton.transform.Find("Inactive")?.GetComponent<SpriteRenderer>();
if (sprite != null)
{
sprite.color = new Color(0.35f, 1f, 1f, 1f); // Corrected color assignment
}
}
}
}
}
}
@@ -225,7 +225,10 @@ internal static class ChatCommandsPatch
{
for (int i = 1; i < typedParts.Length && i <= closestCommand.Arguments.Length; i++)
{
closestCommand.Arguments[i - 1]?.Arg = typedParts[i];
if (closestCommand.Arguments[i - 1] != null)
{
closestCommand.Arguments[i - 1].Arg = typedParts[i]; // Safe assignment
}
}
}