#include "teamplay.qh"
#include "spawnpoints.qh"
#include "resources.qh"
-#include "g_damage.qh"
+#include "damage.qh"
#include "handicap.qh"
-#include "g_hook.qh"
+#include "hook.qh"
#include "command/common.qh"
#include "command/vote.qh"
#include "clientkill.qh"
#include "cheats.qh"
-#include "g_world.qh"
+#include "world.qh"
#include <server/gamelog.qh>
#include "race.qh"
-#include <server/sv_main.qh>
+#include <server/main.qh>
#include "antilag.qh"
#include "campaign.qh"
#include "command/common.qh"
#include <common/weapons/weapon/vortex.qh>
+#define CHAT_NOSPECTATORS() ((autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage))
+
STATIC_METHOD(Client, Add, void(Client this, int _team))
{
ClientConnect(this);
WaypointSprite_PlayerDead(this);
- if (CS(this).killcount != FRAGS_SPECTATOR)
- {
- if(!game_stopped)
- if(autocvar_g_chat_nospectators == 1 || (!warmup_stage && autocvar_g_chat_nospectators == 2))
- Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_CHAT_NOSPECTATORS);
- }
+ if (CS(this).killcount != FRAGS_SPECTATOR && !game_stopped && CHAT_NOSPECTATORS())
+ Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_CHAT_NOSPECTATORS);
accuracy_resend(this);
var .float flood_field = floodcontrol_chat;
if(floodcontrol && source)
{
- float flood_spl;
- float flood_burst;
- float flood_lmax;
- float lines;
+ float flood_spl, flood_burst, flood_lmax;
if(privatesay)
{
flood_spl = autocvar_g_chat_flood_spl_tell;
{
getWrappedLine_remaining = msgstr;
msgstr = "";
- lines = 0;
+ int lines = 0;
while(getWrappedLine_remaining && (!flood_lmax || lines <= flood_lmax))
{
msgstr = strcat(msgstr, " ", getWrappedLineLen(82.4289758859709, strlennocol)); // perl averagewidth.pl < gfx/vera-sans.width
sourcecmsgstr = cmsgstr;
}
- if (!privatesay && source && !(IS_PLAYER(source) || source.caplayer))
+ if (!privatesay && source && !(IS_PLAYER(source) || source.caplayer) && !game_stopped
+ && (teamsay || CHAT_NOSPECTATORS()))
{
- if (!game_stopped)
- if (teamsay || (autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage))
- teamsay = -1; // spectators
+ teamsay = -1; // spectators
}
if(flood)
ret = 1;
}
- if (privatesay && source && !(IS_PLAYER(source) || source.caplayer))
+ if (privatesay && source && !(IS_PLAYER(source) || source.caplayer) && !game_stopped
+ && (IS_PLAYER(privatesay) || privatesay.caplayer) && CHAT_NOSPECTATORS())
{
- if (!game_stopped)
- if ((privatesay && (IS_PLAYER(privatesay) || privatesay.caplayer)) && ((autocvar_g_chat_nospectators == 1) || (autocvar_g_chat_nospectators == 2 && !warmup_stage)))
- ret = -1; // just hide the message completely
+ ret = -1; // just hide the message completely
}
MUTATOR_CALLHOOK(ChatMessage, source, ret);