aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Client/mod/scripts/vscripts
diff options
context:
space:
mode:
authorEmma Miler <27428383+emma-miler@users.noreply.github.com>2022-03-05 01:20:02 +0100
committerGitHub <noreply@github.com>2022-03-05 00:20:02 +0000
commit38834a5e89d482f8152071e8341f662020dafea7 (patch)
tree6fa5517b68eb10db824b6452b1766506254ea814 /Northstar.Client/mod/scripts/vscripts
parent117e04ab6a93cecd809fb19a8b095295fa422a03 (diff)
downloadNorthstarMods-38834a5e89d482f8152071e8341f662020dafea7.tar.gz
NorthstarMods-38834a5e89d482f8152071e8341f662020dafea7.zip
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
Diffstat (limited to 'Northstar.Client/mod/scripts/vscripts')
-rw-r--r--Northstar.Client/mod/scripts/vscripts/_custom_codecallbacks_client.gnut4
1 files 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
+}