mirror of
https://github.com/Jackzmc/sourcemod-plugins.git
synced 2025-05-06 21:43:22 +00:00
Ignore invalid survivor types
This commit is contained in:
parent
d268b498df
commit
da516e0894
2 changed files with 6 additions and 2 deletions
Binary file not shown.
|
@ -168,9 +168,13 @@ public Action Event_PlayerToBot(Handle event, char[] name, bool dontBroadcast)
|
||||||
if (g_Models[player][0] != '\0')
|
if (g_Models[player][0] != '\0')
|
||||||
{
|
{
|
||||||
int playerType = GetEntProp(player, Prop_Send, "m_survivorCharacter");
|
int playerType = GetEntProp(player, Prop_Send, "m_survivorCharacter");
|
||||||
|
if(playerType >= 0 && playerType <= 7) {
|
||||||
SetEntProp(bot, Prop_Send, "m_survivorCharacter", playerType);
|
SetEntProp(bot, Prop_Send, "m_survivorCharacter", playerType);
|
||||||
SetEntityModel(bot, g_Models[player]); // Restore saved model. Player model is hunter at this point
|
|
||||||
SetClientInfo(bot, "name", survivor_names[playerType]);
|
SetClientInfo(bot, "name", survivor_names[playerType]);
|
||||||
|
} else {
|
||||||
|
PrintToServer("[l4d_survivor_identity_fix]: Ignoring player's (%N) m_survivorCharacter due to out of range (%d)", player, playerType);
|
||||||
|
}
|
||||||
|
SetEntityModel(bot, g_Models[player]); // Restore saved model. Player model is hunter at this point
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue