Skip to content

Commit

Permalink
Fix [BOT] indicator color not being cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
ninesphere committed May 7, 2023
1 parent ed46dd0 commit b99ecde
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lua_baselib.c
Original file line number Diff line number Diff line change
Expand Up @@ -3589,14 +3589,14 @@ static int lib_gAddPlayer(lua_State *L)
char joinmsg[256];

// Truncate bot name
player_names[newplayernum][sizeof(*player_names) - 7] = '\0'; // The length of colored [BOT] + 1
player_names[newplayernum][sizeof(*player_names) - 8] = '\0'; // The length of colored [BOT] + 1

strcpy(joinmsg, M_GetText("\x82*Bot %s has joined the game (player %d)"));
strcpy(joinmsg, va(joinmsg, player_names[newplayernum], newplayernum));
HU_AddChatText(joinmsg, false);

// Append blue [BOT] tag at the end
strlcat(player_names[newplayernum], "\x84[BOT]", sizeof(*player_names));
strlcat(player_names[newplayernum], "\x84[BOT]\x80", sizeof(*player_names));
}

LUA_PushUserdata(L, newplayer, META_PLAYER);
Expand Down

0 comments on commit b99ecde

Please sign in to comment.