From 38834a5e89d482f8152071e8341f662020dafea7 Mon Sep 17 00:00:00 2001 From: Emma Miler <27428383+emma-miler@users.noreply.github.com> Date: Sat, 5 Mar 2022 01:20:02 +0100 Subject: Fix chathooks logic (#258) The original behaviour causes a bug where random players with high player indices would be interpreted as if they were sending server messages --- .../mod/scripts/vscripts/_custom_codecallbacks_client.gnut | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Northstar.Client/mod/scripts/vscripts/_custom_codecallbacks_client.gnut b/Northstar.Client/mod/scripts/vscripts/_custom_codecallbacks_client.gnut index 494262e8..66a40cb0 100644 --- a/Northstar.Client/mod/scripts/vscripts/_custom_codecallbacks_client.gnut +++ b/Northstar.Client/mod/scripts/vscripts/_custom_codecallbacks_client.gnut @@ -76,7 +76,7 @@ void function CHudChat_OnReceivedSayTextMessageCallback(int fromPlayerIndex, str entity fromPlayer = null string fromPlayerName = "" - if (fromPlayerIndex >= 0 && fromPlayerIndex < GetPlayerArray().len()) + if (fromPlayerIndex >= 0 && fromPlayerIndex <= 128) { fromPlayer = GetEntByIndex(fromPlayerIndex + 1) if (fromPlayer == null) { @@ -123,4 +123,4 @@ void function AddCallback_OnReceivedSayTextMessage( ClClient_MessageStruct funct void function NSSetupChathooksClient() { getroottable().rawset("CHudChat_ProcessMessageStartThread", CHudChat_ProcessMessageStartThread) -} \ No newline at end of file +} -- cgit v1.2.3