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:
@@ -184,7 +184,7 @@ public MenuHandler_Beacon(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[32];
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformBeacon(param1, target);
|
||||
|
||||
@@ -208,7 +208,7 @@ public MenuHandler_Amount(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[32];
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformBlind(param1, target, amount);
|
||||
|
||||
@@ -265,7 +265,7 @@ public MenuHandler_Drug(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[32];
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformDrug(param1, target, 2);
|
||||
|
||||
@@ -125,7 +125,7 @@ public Action:Timer_FireBomb(Handle:timer, any:value)
|
||||
|
||||
SetEntityRenderColor(client, 255, color, color, 255);
|
||||
|
||||
char name[64];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(client, name, sizeof(name));
|
||||
PrintCenterTextAll("%t", "Till Explodes", name, g_FireBombTime[client]);
|
||||
|
||||
@@ -304,7 +304,7 @@ public MenuHandler_Burn(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[32];
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
PerformBurn(param1, target, 20.0);
|
||||
ShowActivity2(param1, "[SM] ", "%t", "Set target on fire", "_s", name);
|
||||
@@ -349,7 +349,7 @@ public MenuHandler_FireBomb(Menu menu, MenuAction action, int param1, int param2
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[32];
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformFireBomb(param1, target);
|
||||
|
||||
@@ -165,7 +165,7 @@ public MenuHandler_GravityAmount(Menu menu, MenuAction action, int param1, int p
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[32];
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformGravity(param1, target, amount);
|
||||
|
||||
@@ -246,7 +246,7 @@ public Action:Timer_FreezeBomb(Handle:timer, any:value)
|
||||
|
||||
SetEntityRenderColor(client, color, color, 255, 255);
|
||||
|
||||
char name[64];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(client, name, sizeof(name));
|
||||
PrintCenterTextAll("%t", "Till Explodes", name, g_FreezeBombTime[client]);
|
||||
|
||||
@@ -418,7 +418,7 @@ public MenuHandler_Freeze(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[32];
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformFreeze(param1, target, g_Cvar_FreezeDuration.IntValue);
|
||||
@@ -464,7 +464,7 @@ public MenuHandler_FreezeBomb(Menu menu, MenuAction action, int param1, int para
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[32];
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformFreezeBomb(param1, target);
|
||||
|
||||
@@ -109,7 +109,7 @@ public MenuHandler_NoClip(Menu menu, MenuAction action, int param1, int param2)
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[32];
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformNoClip(param1, target);
|
||||
|
||||
@@ -118,7 +118,7 @@ public Action:Timer_TimeBomb(Handle:timer, any:value)
|
||||
|
||||
SetEntityRenderColor(client, 255, 128, color, 255);
|
||||
|
||||
char name[64];
|
||||
char name[MAX_NAME_LENGTH];
|
||||
GetClientName(client, name, sizeof(name));
|
||||
PrintCenterTextAll("%t", "Till Explodes", name, g_TimeBombTime[client]);
|
||||
|
||||
@@ -275,7 +275,7 @@ public MenuHandler_TimeBomb(Menu menu, MenuAction action, int param1, int param2
|
||||
}
|
||||
else
|
||||
{
|
||||
new String:name[32];
|
||||
new String:name[MAX_NAME_LENGTH];
|
||||
GetClientName(target, name, sizeof(name));
|
||||
|
||||
PerformTimeBomb(param1, target);
|
||||
|
||||
Reference in New Issue
Block a user