Skip to content

Commit

Permalink
Prepare simple warlist mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Aug 26, 2024
1 parent f8ce4d9 commit e46f6f6
Show file tree
Hide file tree
Showing 7 changed files with 539 additions and 414 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2409,6 +2409,8 @@ if(CLIENT)
components/chillerbot/vibebot.h
components/chillerbot/warlist.cpp
components/chillerbot/warlist.h
components/chillerbot/warlist_commands_advanced.cpp
components/chillerbot/warlist_commands_simple.cpp
components/console.cpp
components/console.h
components/controls.cpp
Expand Down
1 change: 1 addition & 0 deletions src/engine/shared/chillerbot/variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ MACRO_CONFIG_STR(ClSavedDummySkin, saved_dummy_skin, 24, "default", CFGFLAG_CLIE

// warlist
MACRO_CONFIG_INT(ClWarList, cl_war_list, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Display nameplate color based on chillerbot/warlist directory")
MACRO_CONFIG_INT(ClWarListAdvanced, cl_war_list_advanced, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Activates more complex warlist mode")
MACRO_CONFIG_INT(ClNameplatesWarReason, cl_nameplates_war_reason, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show war reason in name plates")
MACRO_CONFIG_INT(ClWarListAutoReload, cl_war_list_auto_reload, 10, 0, 600, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Reload warlist every x seconds 0=off")

Expand Down
13 changes: 8 additions & 5 deletions src/game/client/components/chillerbot/chatcommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#include <game/client/components/chat.h>

#include "chatcommand.h"
#include "base/system.h"
#include "chatcommand.h"

void CChatCommand::OnServerMsg(const char *pMsg)
{
Expand Down Expand Up @@ -51,7 +51,7 @@ bool CChatCommand::OnChatCmd(char Prefix, int ClientId, int Team, const char *pC
bool CChatCommand::ParseChatCmd(char Prefix, int ClientId, int Team, const char *pCmdWithArgs)
{
char aRawArgLine[512];
aRawArgLine[0] = '\0';
str_copy(aRawArgLine, pCmdWithArgs);
const int MaxArgLen = 256;
char aCmd[MaxArgLen];
int i;
Expand All @@ -61,9 +61,12 @@ bool CChatCommand::ParseChatCmd(char Prefix, int ClientId, int Team, const char
break;
aCmd[i] = pCmdWithArgs[i];
}
const char *pArgStart = str_skip_whitespaces(aCmd + i);
if(pArgStart)
str_copy(aRawArgLine, pArgStart);

int Skip = i;
while(pCmdWithArgs[Skip] && str_isspace(pCmdWithArgs[Skip]))
Skip++;
str_copy(aRawArgLine, pCmdWithArgs + Skip);

aCmd[i] = '\0';
int ROffset = m_pClient->m_ChatHelper.ChatCommandGetROffset(aCmd);

Expand Down
Loading

0 comments on commit e46f6f6

Please sign in to comment.