Fix inconsistencies with buffer sizes for player names.
Found any I could not using MAX_NAME_LENGTH and changed them to use it. I think that we should increase MAX_NAME_LENGTH to 128 for CS:GO at some point as that's what it uses internally. (Presumably to get the client's full multibyte name from Steam without truncation mid-codepoint which can happen in other games. Steam's max is 32 characters if I remember correctly, but allows multibyte chars).
This commit is contained in:
@@ -149,7 +149,7 @@ public MenuHandler_Slap(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
decl String:name[32];
|
||||
decl String:name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
PerformSlap(param1, target, g_SlapDamage[param1]);
|
||||
ShowActivity2(param1, "[SM] ", "%t", "Slapped target", "_s", name);
|
||||
|
||||
@@ -103,7 +103,7 @@ public MenuHandler_Slay(Menu menu, MenuAction action, param1, param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
decl String:name[32];
|
||||
decl String:name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
PerformSlay(param1, target);
|
||||
ShowActivity2(param1, "[SM] ", "%t", "Slayed target", "_s", name);
|
||||
|
||||
Reference in New Issue
Block a user