.vector pos1, pos2;
.vector mangle;
-.float cvar_cl_hitsound;
-
.float pain_finished; //Added by Supajoe
.float pain_frame; //"
.float statdraintime; // record the one-second intervals between draining health and armour when they're over 100
.float speedrunning;
// Q3 support
-.float notteam;
-.float notsingle;
-.float notfree;
-.float notq3a;
float q3acompat_machineshotgunswap;
// database
{
if(self.enemy.typehitsound)
self.typehit_time = time;
- else if(self.enemy.hitsound && self.cvar_cl_hitsound)
+ else if(self.enemy.hitsound)
self.hit_time = time;
}
else
{
if(self.typehitsound)
self.typehit_time = time;
- else if(self.hitsound && self.cvar_cl_hitsound)
+ else if(self.hitsound)
self.hit_time = time;
}
}
GetCvars_handleFloat(s, f, cvar_cl_noantilag, "cl_noantilag");
GetCvars_handleFloat(s, f, cvar_cl_voice_directional, "cl_voice_directional");
GetCvars_handleFloat(s, f, cvar_cl_voice_directional_taunt_attenuation, "cl_voice_directional_taunt_attenuation");
- GetCvars_handleFloat(s, f, cvar_cl_hitsound, "cl_hitsound");
GetCvars_handleFloat(s, f, cvar_cl_accuracy_data_share, "cl_accuracy_data_share");
GetCvars_handleFloat(s, f, cvar_cl_accuracy_data_receive, "cl_accuracy_data_receive");
.float anglejitter;
.string gametypefilter;
.string cvarfilter;
+float DoesQ3ARemoveThisEntity();
void SV_OnEntityPreSpawnFunction()
{
if(self.gametypefilter != "")
}
}
+ if(DoesQ3ARemoveThisEntity())
+ {
+ remove(self);
+ return;
+ }
+
// support special -1 and -2 angle from radiant
if (self.angles == '0 -1 0')
self.angles = '-90 0 0';
waypoint_spawnforitem(self);
}
- if(teams_matter)
- {
- if(self.notteam)
- {
- print("removed non-teamplay ", self.classname, "\n");
- startitem_failed = TRUE;
- remove (self);
- return;
- }
- }
- else
- {
- if(self.notfree)
- {
- print("removed non-FFA ", self.classname, "\n");
- startitem_failed = TRUE;
- remove (self);
- return;
- }
- }
-
- if(self.notq3a)
- {
- // We aren't TA or something like that, so we keep the Q3A entities
- print("removed non-Q3A ", self.classname, "\n");
- startitem_failed = TRUE;
- remove (self);
- return;
- }
-
/*
* can't do it that way, as it would break maps
* TODO make a target_give like entity another way, that perhaps has
void spawnfunc_team_CTF_bluespawn() { spawnfunc_info_player_team2(); }
void spawnfunc_item_flight() { spawnfunc_item_jetpack(); }
+
+.float notteam;
+.float notsingle;
+.float notfree;
+.float notq3a;
+.string gametype;
+float DoesQ3ARemoveThisEntity()
+{
+ // Q3 style filters (DO NOT USE, THIS IS COMPAT ONLY)
+
+ if(self.notq3a)
+ return 1;
+
+ if(self.notsingle)
+ if(maxclients == 1)
+ return 1;
+
+ if(self.notteam)
+ if(teams_matter)
+ return 1;
+
+ if(self.notfree)
+ if(!teams_matter)
+ return 1;
+
+ if(self.gametype)
+ {
+ string gametypename;
+ // static char *gametypeNames[] = {"ffa", "tournament", "single", "team", "ctf", "oneflag", "obelisk", "harvester", "teamtournament"};
+ gametypename = "ffa";
+ if(teams_matter)
+ gametypename = "team";
+ if(g_arena)
+ gametypename = "tournament";
+ if(g_ctf)
+ gametypename = "ctf";
+ if(maxclients == 1)
+ gametypename = "single";
+ // we do not have the other types (oneflag, obelisk, harvester, teamtournament)
+ if(strstrofs(self.gametype, gametypename, 0) < 0)
+ return 1;
+ }
+
+ return 0;
+}