Backed out changeset fa286305bd3f
This commit is contained in:
parent
c968dfa113
commit
3623ee3ce8
@ -46,13 +46,6 @@
|
||||
* String to use as the silent chat trigger. Set an empty string to disable.
|
||||
*/
|
||||
"SilentChatTrigger" "/"
|
||||
|
||||
/**
|
||||
* Optional, second string to use as the silent chat trigger. Set an empty
|
||||
* string to disable. This is can be useful on games that steal the primary
|
||||
* choice (such as TF2 and "/")
|
||||
*/
|
||||
"SilentChatTrigger2" "."
|
||||
|
||||
/**
|
||||
* If a say command is a silent chat trigger, and is used by an admin,
|
||||
|
@ -63,10 +63,8 @@ ChatTriggers::ChatTriggers() : m_pSayCmd(NULL), m_bWillProcessInPost(false),
|
||||
{
|
||||
m_PubTrigger = sm_strdup("!");
|
||||
m_PrivTrigger = sm_strdup("/");
|
||||
m_PrivTrigger2 = sm_strdup(".");
|
||||
m_PubTriggerSize = 1;
|
||||
m_PrivTriggerSize = 1;
|
||||
m_PrivTriggerSize2 = 1;
|
||||
m_bIsChatTrigger = false;
|
||||
}
|
||||
|
||||
@ -76,8 +74,6 @@ ChatTriggers::~ChatTriggers()
|
||||
m_PubTrigger = NULL;
|
||||
delete [] m_PrivTrigger;
|
||||
m_PrivTrigger = NULL;
|
||||
delete [] m_PrivTrigger2;
|
||||
m_PrivTrigger2 = NULL;
|
||||
}
|
||||
|
||||
ConfigResult ChatTriggers::OnSourceModConfigChanged(const char *key,
|
||||
@ -100,13 +96,6 @@ ConfigResult ChatTriggers::OnSourceModConfigChanged(const char *key,
|
||||
m_PrivTriggerSize = strlen(m_PrivTrigger);
|
||||
return ConfigResult_Accept;
|
||||
}
|
||||
else if (strcmp(key, "SilentChatTrigger2") == 0)
|
||||
{
|
||||
delete [] m_PrivTrigger2;
|
||||
m_PrivTrigger2 = sm_strdup(value);
|
||||
m_PrivTriggerSize2 = strlen(m_PrivTrigger2);
|
||||
return ConfigResult_Accept;
|
||||
}
|
||||
else if (strcmp(key, "SilentFailSuppress") == 0)
|
||||
{
|
||||
g_bSupressSilentFails = strcmp(value, "yes") == 0;
|
||||
@ -263,18 +252,12 @@ void ChatTriggers::OnSayCommand_Pre()
|
||||
is_trigger = true;
|
||||
args = &args[m_PubTriggerSize];
|
||||
}
|
||||
else if (m_PrivTriggerSize && strncmp(args, m_PrivTrigger, m_PrivTriggerSize) == 0)
|
||||
else if (m_PrivTriggerSize && strncmp(args, m_PrivTrigger, m_PrivTriggerSize) == 0)
|
||||
{
|
||||
is_trigger = true;
|
||||
is_silent = true;
|
||||
args = &args[m_PrivTriggerSize];
|
||||
}
|
||||
else if (m_PrivTriggerSize2 && strncmp(args, m_PrivTrigger2, m_PrivTriggerSize2) == 0)
|
||||
{
|
||||
is_trigger = true;
|
||||
is_silent = true;
|
||||
args = &args[m_PrivTriggerSize2];
|
||||
}
|
||||
|
||||
if (!is_trigger)
|
||||
{
|
||||
|
@ -75,9 +75,7 @@ private:
|
||||
char *m_PubTrigger;
|
||||
size_t m_PubTriggerSize;
|
||||
char *m_PrivTrigger;
|
||||
char *m_PrivTrigger2;
|
||||
size_t m_PrivTriggerSize;
|
||||
size_t m_PrivTriggerSize2;
|
||||
bool m_bWillProcessInPost;
|
||||
bool m_bTriggerWasSilent;
|
||||
bool m_bIsChatTrigger;
|
||||
|
Loading…
Reference in New Issue
Block a user