Skip to content

Commit

Permalink
fix: do not auto-rejoin if disconnected with mod (#334)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Winston H. <[email protected]>
Co-authored-by: winstxnhdw <[email protected]>
  • Loading branch information
4 people authored Jan 31, 2024
1 parent 144e6ce commit 1e3765e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lc-hax/Scripts/Modules/AntiKickMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void Update() {
this.HasAnnouncedGameJoin = true;

Helper.CreateComponent<WaitForBehaviour>().SetPredicate(time => time > 1.0f).Init(() => {
Chat.Announce($"{Helper.LocalPlayer?.playerUsername} disconnected.", true);
Chat.Clear();
Chat.Print("You are invisible! Do /invis to disable!");
});
}
Expand Down
3 changes: 3 additions & 0 deletions lc-hax/Scripts/Modules/DisconnectMod.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Hax;
using UnityEngine;

public sealed class DisconnectMod : MonoBehaviour {
Expand All @@ -17,6 +18,8 @@ void OnDisable() {

void TryToDisconnect() {
if (!this.IsShiftHeld) return;

GameNetworkManager.Instance.Disconnect();
Setting.DisconnectedVoluntarily = true;
}
}

0 comments on commit 1e3765e

Please sign in to comment.