if (head.noise != "")
if(self.enemy)
- sound(self.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
+ _sound(self.enemy, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
else
- sound(self, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
+ _sound(self, CH_TRIGGER, head.noise, VOL_BASE, ATTEN_NORM);
if (head.noise1 != "")
play2all(head.noise1);
// copy important properties from spawnfunc_dom_team entity
self.goalentity = head;
- setmodel(self, head.mdl); // precision already set
+ _setmodel(self, head.mdl); // precision already set
self.skin = head.skin;
self.cnt = -1;
MUTATOR_HOOKFUNCTION(dom_ResetMap)
{SELFPARAM();
total_pps = 0, pps_red = 0, pps_blue = 0, pps_yellow = 0, pps_pink = 0;
- FOR_EACH_PLAYER(self)
+ entity e;
+ FOR_EACH_PLAYER(e)
{
+ setself(e);
PutClientInServer();
self.player_blocked = 1;
if(IS_REAL_CLIENT(self))
/*QUAKED spawnfunc_dom_controlpoint (0 .5 .8) (-16 -16 -24) (16 16 32)
Control point for Domination gameplay.
*/
-void spawnfunc_dom_controlpoint()
-{SELFPARAM();
+spawnfunc(dom_controlpoint)
+{
if(!g_domination)
{
remove(self);
(this is a global sound, like "Red team has captured a control point")
*/
-void spawnfunc_dom_team()
-{SELFPARAM();
+spawnfunc(dom_team)
+{
if(!g_domination || autocvar_g_domination_teams_override >= 2)
{
remove(self);
if (self.noise1 != "")
precache_sound(self.noise1);
self.classname = "dom_team";
- setmodel(self, self.model); // precision not needed
+ _setmodel(self, self.model); // precision not needed
self.mdl = self.model;
self.dmg = self.modelindex;
self.model = "";
// code from here on is just to support maps that don't have control point and team entities
void dom_spawnteam (string teamname, float teamcolor, string pointmodel, float pointskin, string capsound, string capnarration, string capmessage)
{SELFPARAM();
- entity oldself;
- oldself = self;
- self = spawn();
+ setself(spawn());
self.classname = "dom_team";
self.netname = teamname;
self.cnt = teamcolor;
self.message = capmessage;
// this code is identical to spawnfunc_dom_team
- setmodel(self, self.model); // precision not needed
+ _setmodel(self, self.model); // precision not needed
self.mdl = self.model;
self.dmg = self.modelindex;
self.model = "";
self.team = self.cnt + 1;
//eprint(self);
- self = oldself;
+ setself(this);
}
+void _spawnfunc_dom_controlpoint() { SELFPARAM(); spawnfunc_dom_controlpoint(self); }
void dom_spawnpoint(vector org)
{SELFPARAM();
- entity oldself;
- oldself = self;
- self = spawn();
+ setself(spawn());
self.classname = "dom_controlpoint";
- self.think = spawnfunc_dom_controlpoint;
+ self.think = _spawnfunc_dom_controlpoint;
self.nextthink = time;
setorigin(self, org);
- spawnfunc_dom_controlpoint();
- self = oldself;
+ spawnfunc_dom_controlpoint(this);
+ setself(this);
}
// spawn some default teams if the map is not set up for domination
void dom_spawnteams(float teams)
{
- dom_spawnteam("Red", NUM_TEAM_1-1, "models/domination/dom_red.md3", 0, "domination/claim.wav", "", "Red team has captured a control point");
- dom_spawnteam("Blue", NUM_TEAM_2-1, "models/domination/dom_blue.md3", 0, "domination/claim.wav", "", "Blue team has captured a control point");
+ dom_spawnteam("Red", NUM_TEAM_1-1, "models/domination/dom_red.md3", 0, SND(DOM_CLAIM), "", "Red team has captured a control point");
+ dom_spawnteam("Blue", NUM_TEAM_2-1, "models/domination/dom_blue.md3", 0, SND(DOM_CLAIM), "", "Blue team has captured a control point");
if(teams >= 3)
- dom_spawnteam("Yellow", NUM_TEAM_3-1, "models/domination/dom_yellow.md3", 0, "domination/claim.wav", "", "Yellow team has captured a control point");
+ dom_spawnteam("Yellow", NUM_TEAM_3-1, "models/domination/dom_yellow.md3", 0, SND(DOM_CLAIM), "", "Yellow team has captured a control point");
if(teams >= 4)
- dom_spawnteam("Pink", NUM_TEAM_4-1, "models/domination/dom_pink.md3", 0, "domination/claim.wav", "", "Pink team has captured a control point");
+ dom_spawnteam("Pink", NUM_TEAM_4-1, "models/domination/dom_pink.md3", 0, SND(DOM_CLAIM), "", "Pink team has captured a control point");
dom_spawnteam("", 0, "models/domination/dom_unclaimed.md3", 0, "", "", "");
}
void dom_Initialize()
{
- precache_model("models/domination/dom_red.md3");
- precache_model("models/domination/dom_blue.md3");
- precache_model("models/domination/dom_yellow.md3");
- precache_model("models/domination/dom_pink.md3");
- precache_model("models/domination/dom_unclaimed.md3");
- precache_sound("domination/claim.wav");
-
InitializeEntity(world, dom_DelayedInit, INITPRIO_GAMETYPE);
}