#include "teamplay.qh"
+#include "_all.qh"
+
+#include "cl_client.qh"
+#include "race.qh"
+#include "scores.qh"
+#include "scores_rules.qh"
+
+#include "bot/bot.qh"
+
+#include "command/vote.qh"
+
+#include "mutators/mutators_include.qh"
+
+#include "../common/deathtypes.qh"
+#include "../common/teams.qh"
void TeamchangeFrags(entity e)
{
{
serverflags |= SERVERFLAG_TEAMPLAY;
teamplay = 1;
+ cvar_set("teamplay", "2"); // DP needs this for sending proper getstatus replies.
}
void InitGameplayMode()
world.maxs = mi_max;
MapInfo_LoadMapSettings(mapname);
- teamplay = 0;
serverflags &= ~SERVERFLAG_TEAMPLAY;
+ teamplay = 0;
+ cvar_set("teamplay", "0"); // DP needs this for sending proper getstatus replies.
if (!cvar_value_issafe(world.fog))
{
- print("The current map contains a potentially harmful fog setting, ignored\n");
+ LOG_INFO("The current map contains a potentially harmful fog setting, ignored\n");
world.fog = string_null;
}
if(MapInfo_Map_fog != "")
if(g_dm)
{
+ MUTATOR_ADD(gamemode_deathmatch);
}
if(g_tdm)
ActivateTeamplay();
fraglimit_override = autocvar_g_keyhunt_point_limit;
leadlimit_override = autocvar_g_keyhunt_point_leadlimit;
+ if(autocvar_g_keyhunt_team_spawns)
+ have_team_spawns = -1; // request team spawns
MUTATOR_ADD(gamemode_keyhunt);
}
if(g_onslaught)
{
ActivateTeamplay();
+ fraglimit_override = autocvar_g_onslaught_point_limit;
have_team_spawns = -1; // request team spawns
MUTATOR_ADD(gamemode_onslaught);
}
InitializeEntity(world, default_delayedinit, INITPRIO_GAMETYPE_FALLBACK);
}
-string GetClientVersionMessage() {
+string GetClientVersionMessage()
+{SELFPARAM();
string versionmsg;
if (self.version_mismatch) {
if(self.version < autocvar_gameversion) {
{
string s, modifications, motd;
- ret_string = "";
- MUTATOR_CALLHOOK(BuildMutatorsPrettyString);
+ MUTATOR_CALLHOOK(BuildMutatorsPrettyString, "");
modifications = ret_string;
if(g_weaponarena)
else
modifications = strcat(modifications, ", ", g_weaponarena_list, " Arena");
}
- if(cvar("g_balance_blaster_weaponstart") == 0)
+ else if(cvar("g_balance_blaster_weaponstart") == 0)
modifications = strcat(modifications, ", No start weapons");
if(cvar("sv_gravity") < stof(cvar_defstring("sv_gravity")))
modifications = strcat(modifications, ", Low gravity");
s = strcat(s, "\n\n^8special gameplay tips: ^7", cache_mutatormsg);
}
+ string mutator_msg = "";
+ MUTATOR_CALLHOOK(BuildGameplayTipsString, mutator_msg);
+ mutator_msg = ret_string;
+
+ s = strcat(s, mutator_msg); // trust that the mutator will do proper formatting
+
motd = autocvar_sv_motd;
if (motd != "") {
s = strcat(s, "\n\n^8MOTD: ^7", strreplace("\\n", "\n", motd));
// set c1...c4 to show what teams are allowed
void CheckAllowedTeams (entity for_whom)
-{
+{SELFPARAM();
float dm;
entity head;
string teament_name;
// cover anything else by treating it like tdm with no teams spawned
dm = 2;
- ret_float = dm;
- MUTATOR_CALLHOOK(GetTeamCount);
+ MUTATOR_CALLHOOK(GetTeamCount, dm);
dm = ret_float;
if(dm >= 4)
}
float JoinBestTeam(entity pl, float only_return_best, float forcebestteam)
-{
+{SELFPARAM();
float smallest, selectedteam;
// don't join a team if we're not playing a team game
//void() ctf_playerchanged;
void SV_ChangeTeam(float _color)
-{
+{SELFPARAM();
float scolor, dcolor, steam, dteam; //, dbotcount, scount, dcount;
// in normal deathmatch we can just apply the color and we're done
TeamchangeFrags(self);
}
- SetPlayerTeam(self, dteam, steam, false);
+ // since this is an engine function, and gamecode doesn't have any calls earlier than this, do the connecting message here
+ if(!IS_CLIENT(self))
+ Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_CONNECTING, self.netname);
+
+ SetPlayerTeam(self, dteam, steam, !IS_CLIENT(self));
if(IS_PLAYER(self) && steam != dteam)
{