void bot_clientdisconnect(entity this);
void W_HitPlotClose(entity this);
void anticheat_report(entity this);
-void playerdemo_shutdown();
+void playerdemo_shutdown(entity this);
void entcs_detach(entity this);
void accuracy_free(entity this);
void ClientData_Detach(entity this);
W_HitPlotClose(this);
anticheat_report(this);
- playerdemo_shutdown();
+ playerdemo_shutdown(this);
entcs_detach(this);
- accuracy_free(self);
+ accuracy_free(this);
ClientData_Detach(this);
- PlayerScore_Detach(self);
+ PlayerScore_Detach(this);
}
return;
}
- WITHSELF(client, playerdemo_open_read(argv(next_token)));
+ playerdemo_open_read(client, argv(next_token));
return;
}
return;
}
- WITHSELF(client, playerdemo_open_write(argv(next_token)));
+ playerdemo_open_write(client, argv(next_token));
return;
}
{
this.playerdemo_mode = PLAYERDEMO_MODE_OFF;
}
-void playerdemo_shutdown()
-{SELFPARAM();
- if(self.playerdemo_mode != PLAYERDEMO_MODE_OFF)
+void playerdemo_shutdown(entity this)
+{
+ if(this.playerdemo_mode != PLAYERDEMO_MODE_OFF)
{
- LOG_INFO("playerdemo: ", self.netname, " closed\n");
- fclose(self.playerdemo_fh);
+ LOG_INFO("playerdemo: ", this.netname, " closed\n");
+ fclose(this.playerdemo_fh);
}
- self.playerdemo_mode = 0;
+ this.playerdemo_mode = 0;
}
-void playerdemo_open_read(string f)
-{SELFPARAM();
- playerdemo_shutdown();
- self.playerdemo_mode = PLAYERDEMO_MODE_READING;
- self.playerdemo_fh = fopen(f, FILE_READ);
- self.playerdemo_starttime = time - 1;
- self.playerdemo_time = stof(fgets(self.playerdemo_fh));
- self.playerdemo_time += self.playerdemo_starttime;
- self.movetype = MOVETYPE_NONE;
- LOG_INFO("playerdemo: ", self.netname, " reading from ", f, "\n");
-}
-void playerdemo_open_write(string f)
-{SELFPARAM();
- playerdemo_shutdown();
- self.playerdemo_mode = PLAYERDEMO_MODE_WRITING;
- self.playerdemo_fh = fopen(f, FILE_WRITE);
- self.playerdemo_starttime = time - 1;
- LOG_INFO("playerdemo: ", self.netname, " writing to ", f, "\n");
+void playerdemo_open_read(entity this, string f)
+{
+ playerdemo_shutdown(this);
+ this.playerdemo_mode = PLAYERDEMO_MODE_READING;
+ this.playerdemo_fh = fopen(f, FILE_READ);
+ this.playerdemo_starttime = time - 1;
+ this.playerdemo_time = stof(fgets(this.playerdemo_fh));
+ this.playerdemo_time += this.playerdemo_starttime;
+ this.movetype = MOVETYPE_NONE;
+ LOG_INFO("playerdemo: ", this.netname, " reading from ", f, "\n");
+}
+void playerdemo_open_write(entity this, string f)
+{
+ playerdemo_shutdown(this);
+ this.playerdemo_mode = PLAYERDEMO_MODE_WRITING;
+ this.playerdemo_fh = fopen(f, FILE_WRITE);
+ this.playerdemo_starttime = time - 1;
+ LOG_INFO("playerdemo: ", this.netname, " writing to ", f, "\n");
LOG_INFO("WARNING: playerdemo file format is incomplete and not stable yet. DO NOT RELY ON IT!\n");
}
#define PLAYERDEMO_FIELD(func,t,f) func##t(f,#f);
#pragma once
void playerdemo_init(entity this);
-void playerdemo_shutdown();
+void playerdemo_shutdown(entity this);
void playerdemo_write();
float playerdemo_read(entity this);
-void playerdemo_open_read(string f);
-void playerdemo_open_write(string f);
+void playerdemo_open_read(entity this, string f);
+void playerdemo_open_write(entity this, string f);
#ifdef PORTALS_ARE_NOT_SOLID
// portal is being removed?
- if(self.solid != SOLID_TRIGGER)
+ if(this.solid != SOLID_TRIGGER)
return; // possibly engine bug
if(IS_PLAYER(other))
if(other.vehicle_flags & VHF_ISVEHICLE)
return; // no teleporting vehicles?
- if(!self.enemy)
+ if(!this.enemy)
error("Portal_Touch called for a broken portal\n");
#ifdef PORTALS_ARE_NOT_SOLID
if(other.classname == "porto")
{
- if(other.portal_id == self.portal_id)
+ if(other.portal_id == this.portal_id)
return;
}
- if(time < self.portal_activatetime)
- if(other == self.aiment)
+ if(time < this.portal_activatetime)
+ if(other == this.aiment)
{
- self.portal_activatetime = time + 0.1;
+ this.portal_activatetime = time + 0.1;
return;
}
- if(other != self.aiment)
+ if(other != this.aiment)
if(IS_PLAYER(other))
- if(IS_INDEPENDENT_PLAYER(other) || IS_INDEPENDENT_PLAYER(self.aiment))
+ if(IS_INDEPENDENT_PLAYER(other) || IS_INDEPENDENT_PLAYER(this.aiment))
return; // cannot go through someone else's portal
- if(other.aiment != self.aiment)
+ if(other.aiment != this.aiment)
if(IS_PLAYER(other.aiment))
- if(IS_INDEPENDENT_PLAYER(other.aiment) || IS_INDEPENDENT_PLAYER(self.aiment))
+ if(IS_INDEPENDENT_PLAYER(other.aiment) || IS_INDEPENDENT_PLAYER(this.aiment))
return; // cannot go through someone else's portal
- fixedmakevectors(self.mangle);
+ fixedmakevectors(this.mangle);
g = frametime * '0 0 -1' * autocvar_sv_gravity;
- if(!Portal_WillHitPlane(other.origin, other.mins, other.maxs, other.velocity + g, self.origin, v_forward, self.maxs.x))
+ if(!Portal_WillHitPlane(other.origin, other.mins, other.maxs, other.velocity + g, this.origin, v_forward, this.maxs.x))
return;
/*
}
*/
- if(Portal_TeleportPlayer(self, other))
+ if(Portal_TeleportPlayer(this, other))
if(other.classname == "porto")
if(other.effects & EF_RED)
other.effects += EF_BLUE - EF_RED;
#ifdef PORTALS_ARE_NOT_SOLID
// portal is being removed?
- if(self.solid != SOLID_TRIGGER)
+ if(this.solid != SOLID_TRIGGER)
return; // possibly engine bug
- if(!self.enemy)
+ if(!this.enemy)
error("Portal_Think called for a broken portal\n");
- o = self.aiment;
- self.solid = SOLID_BBOX;
- self.aiment = world;
+ o = this.aiment;
+ this.solid = SOLID_BBOX;
+ this.aiment = world;
g = frametime * '0 0 -1' * autocvar_sv_gravity;
- fixedmakevectors(self.mangle);
+ fixedmakevectors(this.mangle);
FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
if(it != o)
if(IS_INDEPENDENT_PLAYER(it) || IS_INDEPENDENT_PLAYER(o))
continue; // cannot go through someone else's portal
- if(it != o || time >= self.portal_activatetime)
- Portal_Think_TryTeleportPlayer(self, it, g);
+ if(it != o || time >= this.portal_activatetime)
+ Portal_Think_TryTeleportPlayer(this, it, g);
if(it.hook)
- Portal_Think_TryTeleportPlayer(self, it.hook, g);
+ Portal_Think_TryTeleportPlayer(this, it.hook, g);
));
- self.solid = SOLID_TRIGGER;
- self.aiment = o;
+ this.solid = SOLID_TRIGGER;
+ this.aiment = o;
#endif
- self.nextthink = time;
+ this.nextthink = time;
- if(time > self.fade_time)
- Portal_Remove(self, 0);
+ if(time > this.fade_time)
+ Portal_Remove(this, 0);
}
float Portal_Customize()
{SELFPARAM();
if(IS_SPEC(other))
other = other.enemy;
- if(other == self.aiment)
+ if(other == this.aiment)
{
- self.modelindex = self.savemodelindex;
+ this.modelindex = this.savemodelindex;
}
- else if(IS_INDEPENDENT_PLAYER(other) || IS_INDEPENDENT_PLAYER(self.aiment))
+ else if(IS_INDEPENDENT_PLAYER(other) || IS_INDEPENDENT_PLAYER(this.aiment))
{
- self.modelindex = 0;
+ this.modelindex = 0;
}
else
{
- self.modelindex = self.savemodelindex;
+ this.modelindex = this.savemodelindex;
}
return true;
}
}
void Portal_RemoveLater_Think()
{SELFPARAM();
- Portal_Remove(self, self.cnt);
+ Portal_Remove(this, this.cnt);
}
void Portal_RemoveLater(entity portal, float kill)
{
void penalty_touch()
{SELFPARAM();
EXACTTRIGGER_TOUCH;
- if(other.race_lastpenalty != self)
+ if(other.race_lastpenalty != this)
{
- other.race_lastpenalty = self;
- race_ImposePenaltyTime(other, self.race_penalty, self.race_penalty_reason);
+ other.race_lastpenalty = this;
+ race_ImposePenaltyTime(other, this.race_penalty, this.race_penalty_reason);
}
}
longflags = 0;
for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
- if(self.(teamscores[i]) > 127 || self.(teamscores[i]) <= -128)
+ if(this.(teamscores[i]) > 127 || this.(teamscores[i]) <= -128)
longflags |= p;
#if MAX_TEAMSCORE <= 8
if(sendflags & p)
{
if(longflags & p)
- WriteInt24_t(MSG_ENTITY, self.(teamscores[i]));
+ WriteInt24_t(MSG_ENTITY, this.(teamscores[i]));
else
- WriteChar(MSG_ENTITY, self.(teamscores[i]));
+ WriteChar(MSG_ENTITY, this.(teamscores[i]));
}
return true;
s = GetGametype();
s = strcat(s, ":", autocvar_g_xonoticversion);
s = strcat(s, ":P", ftos(cvar_purechanges_count));
- s = strcat(s, ":S", ftos(nJoinAllowed(self, world)));
+ s = strcat(s, ":S", ftos(nJoinAllowed(this, world))); // note: self/this is most likely world in this case
s = strcat(s, ":F", ftos(serverflags));
s = strcat(s, ":M", modname);
s = strcat(s, "::", GetPlayerScoreString(world, (fullstatus ? 1 : 2)));