mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-29 15:42:03 +00:00
Actually check bot names in lib_gAddPlayer.
This commit is contained in:
parent
fdee3a2b7f
commit
9fee550fb0
1 changed files with 6 additions and 6 deletions
|
@ -3486,7 +3486,7 @@ static int lib_gAddPlayer(lua_State *L)
|
||||||
|
|
||||||
// Read the bot name, if given
|
// Read the bot name, if given
|
||||||
if (!lua_isnoneornil(L, 3))
|
if (!lua_isnoneornil(L, 3))
|
||||||
strcpy(player_names[newplayernum], luaL_checkstring(L, 3));
|
strlcpy(player_names[newplayernum], luaL_checkstring(L, 3), sizeof(*player_names));
|
||||||
|
|
||||||
bot = luaL_optinteger(L, 4, 3);
|
bot = luaL_optinteger(L, 4, 3);
|
||||||
newplayer->bot = (bot >= BOT_NONE && bot <= BOT_MPAI) ? bot : BOT_MPAI;
|
newplayer->bot = (bot >= BOT_NONE && bot <= BOT_MPAI) ? bot : BOT_MPAI;
|
||||||
|
|
Loading…
Reference in a new issue