Fix changing target UID when talking to the server

This commit is contained in:
KingRainbow44 2023-05-20 03:03:13 -04:00
parent cad6e90c90
commit d5de603d76
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE

View File

@ -145,8 +145,11 @@ public class ChatSystem implements ChatSystemHandler {
event.call(); if (event.isCanceled()) return; event.call(); if (event.isCanceled()) return;
// Fetch the new target. // Fetch the new target.
targetUid = event.getTargetUid(); if (targetUid != GameConstants.SERVER_CONSOLE_UID) {
if (targetUid == -1) return; targetUid = event.getTargetUid();
if (targetUid == -1) return;
}
// Fetch the new message. // Fetch the new message.
message = event.getMessage(); message = event.getMessage();
if (message == null || message.length() == 0) return; if (message == null || message.length() == 0) return;
@ -179,8 +182,10 @@ public class ChatSystem implements ChatSystemHandler {
event.call(); if (event.isCanceled()) return; event.call(); if (event.isCanceled()) return;
// Fetch the new target. // Fetch the new target.
targetUid = event.getTargetUid(); if (targetUid != GameConstants.SERVER_CONSOLE_UID) {
if (targetUid == -1) return; targetUid = event.getTargetUid();
if (targetUid == -1) return;
}
// Fetch the new emote. // Fetch the new emote.
emote = event.getMessageAsInt(); emote = event.getMessageAsInt();
if (emote == -1) return; if (emote == -1) return;