bool hitplayer = false;
int species, forcemul;
vector force, thisforce;
- entity oldself;
-
- oldself = self;
w_deathtype = ReadShort();
w_issilent = (w_deathtype & 0x8000);
if(self.isplayermodel)
hitplayer = true; // this impact damaged a player
}
- setself(oldself);
+ setself(this);
if(DEATH_ISVEHICLE(w_deathtype))
{
return;
vector org = self.origin + ((self.mins + self.maxs) * 0.5);
- entity e = spawn(), oldself = self;
+ entity e = spawn();
e.monster_loot = self.monster_loot;
e.item_spawnshieldtime = time + 0.7;
e.classname = "droppedweapon"; // use weapon handling to remove it on touch
SUB_SetFade(e, time + autocvar_g_monsters_drop_time, 1);
- setself(oldself);
+ setself(this);
}
}
void _Movetype_LinkEdict_TouchAreaGrid() // SV_LinkEdict_TouchAreaGrid
{SELFPARAM();
- entity oldself = self;
entity oldother = other;
for (entity e = findradius(0.5 * (self.absmin + self.absmax), 0.5 * vlen(self.absmax - self.absmin)); e; e = e.chain)
{
- if(e.move_touch && boxesoverlap(e.absmin, e.absmax, oldself.absmin, oldself.absmax))
+ if(e.move_touch && boxesoverlap(e.absmin, e.absmax, this.absmin, this.absmax))
{
setself(e);
- other = oldself;
+ other = this;
trace_allsolid = false;
trace_startsolid = false;
trace_endpos = e.origin;
trace_plane_normal = '0 0 1';
trace_plane_dist = 0;
- trace_ent = oldself;
+ trace_ent = this;
e.move_touch();
}
}
other = oldother;
- setself(oldself);
+ setself(this);
}
void _Movetype_LinkEdict(bool touch_triggers) // SV_LinkEdict
void door_fire()
{SELFPARAM();
- entity oself;
entity starte;
if (self.owner != self)
objerror ("door_fire: self.owner != self");
- oself = self;
-
if (self.spawnflags & DOOR_TOGGLE)
{
if (self.state == STATE_UP || self.state == STATE_TOP)
}
setself(self.enemy);
} while ( (self != starte) && (self != world) );
- setself(oself);
+ setself(this);
return;
}
}
}
setself(self.enemy);
} while ( (self != starte) && (self != world) );
- setself(oself);
+ setself(this);
}
void door_use()
*/
void trigger_keylock_trigger(string s)
{SELFPARAM();
- entity stemp = self;
entity otemp = other;
entity atemp = activator;
if(t.use)
{
setself(t);
- other = stemp;
+ other = this;
activator = atemp;
self.use();
}
- setself(stemp);
+ setself(this);
other = otemp;
activator = atemp;
}
*/
void SUB_UseTargets()
{SELFPARAM();
- entity t, stemp, otemp, act;
+ entity t, otemp, act;
string s;
float i;
// fire targets
//
act = activator;
- stemp = self;
otemp = other;
- if(stemp.target_random)
+ if(this.target_random)
RandomSelection_Init();
for(i = 0; i < 4; ++i)
switch(i)
{
default:
- case 0: s = stemp.target; break;
- case 1: s = stemp.target2; break;
- case 2: s = stemp.target3; break;
- case 3: s = stemp.target4; break;
+ case 0: s = this.target; break;
+ case 1: s = this.target2; break;
+ case 2: s = this.target3; break;
+ case 3: s = this.target4; break;
}
if (s != "")
{
for(t = world; (t = find(t, targetname, s)); )
if(t.use)
{
- if(stemp.target_random)
+ if(this.target_random)
{
RandomSelection_Add(t, 0, string_null, 1, 0);
}
if (t.classname == "func_clientwall" || t.classname == "func_clientillusionary")
t.antiwall_flag = aw_flag;
setself(t);
- other = stemp;
+ other = this;
activator = act;
self.use();
}
}
}
- if(stemp.target_random && RandomSelection_chosen_ent)
+ if(this.target_random && RandomSelection_chosen_ent)
{
setself(RandomSelection_chosen_ent);
- other = stemp;
+ other = this;
activator = act;
self.use();
}
activator = act;
- setself(stemp);
+ setself(this);
other = otemp;
}
void turret_do_updates(entity t_turret)
{SELFPARAM();
vector enemy_pos;
- entity oldself;
- oldself = self;
setself(t_turret);
enemy_pos = real_origin(self.enemy);
self.tur_impactent = trace_ent;
self.tur_impacttime = vlen(self.tur_shotorg - trace_endpos) / self.shot_speed;
- setself(oldself);
+ setself(this);
}
/**
self.nextthink = time + self.ticrate;
self.owner.attack_finished_single = time + frametime;
- entity oldself;
- oldself = self;
setself(self.owner);
FireImoBeam ( self.tur_shotorg,
self.tur_shotorg + self.tur_shotdir_updated * self.target_range,
'-1 -1 -1' * self.shot_radius,
'1 1 1' * self.shot_radius,
self.shot_force,
- oldself.shot_dmg,
+ this.shot_dmg,
0.75,
DEATH_TURRET_PHASER);
- setself(oldself);
+ setself(this);
self.scale = vlen(self.owner.tur_shotorg - trace_endpos) / 256;
}
if(self.waypointsprite_attached)
{
WaypointSprite_UpdateRule(self.waypointsprite_attached, self.wp00.team, SPRITERULE_DEFAULT);
- if(oldself == world)
+ if(this == NULL)
WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, self.nextthink);
WaypointSprite_Ping(self.waypointsprite_attached);
}
- if(oldself != world)
- setself(oldself);
+ if(this)
+ setself(this);
}
void vehicles_setreturn(entity veh)
{SELFPARAM();
entity _vehicle;
entity _player;
- entity _oldself = self;
if(vehicles_exit_running)
{
if (_vehicle.vehicle_flags & VHF_PLAYERSLOT)
{
_vehicle.vehicle_exit(eject);
- setself(_oldself);
+ setself(this);
vehicles_exit_running = false;
return;
}
CSQCMODEL_AUTOINIT(self);
- setself(_oldself);
+ setself(this);
vehicles_exit_running = false;
}
if(veh.vehicle_flags & VHF_MULTISLOT)
if(veh.owner)
{
- entity oldself = self;
setself(veh);
other = pl; // TODO: fix
if(veh.gun1.vehicle_enter)
if(veh.gun1.vehicle_enter())
{
- setself(oldself);
+ setself(this);
return;
}
if(veh.gun2.vehicle_enter)
if(veh.gun2.vehicle_enter())
{
- setself(oldself);
+ setself(this);
return;
}
- setself(oldself);
+ setself(this);
}
if(teamplay)
MUTATOR_CALLHOOK(VehicleEnter, pl, veh);
- entity oldself = self;
setself(veh);
CSQCModel_UnlinkEntity();
VEH_ACTION(veh.vehicleid, VR_ENTER);
- setself(oldself);
+ setself(this);
antilag_clear(pl);
}
}
if(self == self.owner.arc_beam) { self.owner.arc_beam = world; }
- entity oldself = self;
setself(self.owner);
if(!WEP_ACTION(WEP_ARC.m_id, WR_CHECKAMMO1) && !WEP_ACTION(WEP_ARC.m_id, WR_CHECKAMMO2))
if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
// note: this doesn't force the switch
W_SwitchToOtherWeapon(self);
}
- setself(oldself);
+ setself(this);
remove(self);
return;
}
void W_Seeker_Vollycontroller_Think(void) // TODO: Merge this with W_Seeker_Attack
{SELFPARAM();
float c;
- entity oldself,oldenemy;
+ entity oldenemy;
self.cnt = self.cnt - 1;
if((!(self.realowner.items & IT_UNLIMITED_AMMO) && self.realowner.WEP_AMMO(SEEKER) < WEP_CVAR(seeker, missile_ammo)) || (self.cnt <= -1) || (self.realowner.deadflag != DEAD_NO) || (self.realowner.switchweapon != WEP_SEEKER.m_id))
self.nextthink = time + WEP_CVAR(seeker, missile_delay) * W_WeaponRateFactor();
- oldself = self;
setself(self.realowner);
oldenemy = self.enemy;
- self.enemy = oldself.enemy;
+ self.enemy = this.enemy;
c = self.cnt % 4;
switch(c)
}
self.enemy = oldenemy;
- setself(oldself);
+ setself(this);
}
void W_Seeker_Tracker_Think(void)
if(csqcplayer)
{
- entity oldself = self;
setself(csqcplayer);
if(servercommandframe == 0 || clientcommandframe == 0)
// relink
setorigin(self, self.origin);
- setself(oldself);
+ setself(this);
}
entity view;
cmd = argv(0);
switch(cmd)
{
- entity e;
float effectnum, f;
vector start, end;
entity oldself;
}
else
{
- e = spawn();
+ entity e = spawn();
e.model = strzone(argv(1));
e.mdl = "rocket_explode";
e.health = 1000;
}
sprint(self, "Usage: sv_cheats 1; restart; cmd penalty 5.0 AHAHAHAHAHAHAH))\n");
break;
- case "dragbox_spawn":
+ case "dragbox_spawn": {
IS_CHEAT(0, argc, 0);
- e = spawn();
+ entity e = spawn();
e.classname = "dragbox_box";
e.think = DragBox_Think;
e.nextthink = time;
setorigin(e.killindicator.killindicator, '0 0 8');
DID_CHEAT();
break;
- case "dragpoint_spawn":
+ }
+ case "dragpoint_spawn": {
IS_CHEAT(0, argc, 0);
- e = spawn();
+ entity e = spawn();
e.classname = "dragpoint";
e.think = DragBox_Think;
e.nextthink = time;
setorigin(e.killindicator.killindicator, '0 0 56');
DID_CHEAT();
break;
+ }
case "drag_remove":
IS_CHEAT(0, argc, 0);
RandomSelection_Init();
crosshair_trace(self);
- for(e = world; (e = find(e, classname, "dragbox_box")); )
+ for(entity e = world; (e = find(e, classname, "dragbox_box")); )
RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
- for(e = world; (e = find(e, classname, "dragpoint")); )
+ for(entity e = world; (e = find(e, classname, "dragpoint")); )
RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
if(RandomSelection_chosen_ent)
{
{
RandomSelection_Init();
crosshair_trace(self);
- for(e = world; (e = find(e, classname, "dragbox_box")); )
+ for(entity e = world; (e = find(e, classname, "dragbox_box")); )
RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
- for(e = world; (e = find(e, classname, "dragpoint")); )
+ for(entity e = world; (e = find(e, classname, "dragpoint")); )
RandomSelection_Add(e, 0, string_null, 1, 1 / vlen(e.origin + (e.mins + e.maxs) * 0.5 - trace_endpos));
if(RandomSelection_chosen_ent)
{
{
f = fopen(argv(1), FILE_WRITE);
fputs(f, "cmd drag_clear\n");
- for(e = world; (e = find(e, classname, "dragbox_box")); )
+ for(entity e = world; (e = find(e, classname, "dragbox_box")); )
{
fputs(f, strcat("cmd dragbox_spawn ", ftos(e.cnt), " \"", vtos(e.aiment.origin), "\" \"", vtos(e.enemy.origin), "\"\n"));
}
- for(e = world; (e = find(e, classname, "dragpoint")); )
+ for(entity e = world; (e = find(e, classname, "dragpoint")); )
{
fputs(f, strcat("cmd dragpoint_spawn ", ftos(e.cnt), " \"", vtos(e.origin), "\"\n"));
}
if(argc == 2)
{
f = fopen(argv(1), FILE_WRITE);
- for(e = world; (e = find(e, classname, "dragbox_box")); )
+ for(entity e = world; (e = find(e, classname, "dragbox_box")); )
{
fputs(f, "{\n");
fputs(f, "\"classname\" \"trigger_race_checkpoint\"\n");
fputs(f, strcat("\"targetname\" \"checkpoint", ftos(e.cnt), "\"\n"));
fputs(f, "}\n");
}
- for(e = world; (e = find(e, classname, "dragpoint")); )
+ for(entity e = world; (e = find(e, classname, "dragpoint")); )
{
start = '0 0 0';
effectnum = 0;
break;
case "drag_clear":
IS_CHEAT(0, argc, 0);
- for(e = world; (e = find(e, classname, "dragbox_box")); )
+ for(entity e = world; (e = find(e, classname, "dragbox_box")); )
remove(e);
- for(e = world; (e = find(e, classname, "dragbox_corner_1")); )
+ for(entity e = world; (e = find(e, classname, "dragbox_corner_1")); )
remove(e);
- for(e = world; (e = find(e, classname, "dragbox_corner_2")); )
+ for(entity e = world; (e = find(e, classname, "dragbox_corner_2")); )
remove(e);
- for(e = world; (e = find(e, classname, "dragpoint")); )
+ for(entity e = world; (e = find(e, classname, "dragpoint")); )
remove(e);
- for(e = world; (e = find(e, classname, "drag_digit")); )
+ for(entity e = world; (e = find(e, classname, "drag_digit")); )
remove(e);
DID_CHEAT();
break;
break;
case "usetarget":
IS_CHEAT(0, argc, 0);
- e = self;
setself(spawn());
self.target = argv(1);
- activator = e;
+ activator = this;
SUB_UseTargets();
remove(self);
- setself(e);
+ setself(this);
DID_CHEAT();
break;
case "killtarget":
IS_CHEAT(0, argc, 0);
- e = self;
setself(spawn());
self.killtarget = argv(1);
- activator = e;
+ activator = this;
SUB_UseTargets();
remove(self);
- setself(e);
+ setself(this);
DID_CHEAT();
break;
case "teleporttotarget":
IS_CHEAT(0, argc, 0);
- e = self;
setself(spawn());
setorigin(self, self.origin);
self.classname = "cheattriggerteleport";
teleport_findtarget();
if(!wasfreed(self))
{
- Simple_TeleportPlayer(self, e);
+ Simple_TeleportPlayer(self, this);
remove(self);
- setself(e);
DID_CHEAT();
}
- else
- setself(e);
+ setself(this);
break;
}
if(self.cnt <= 0)
{
- setself(self.owner);
- ClientKill_Now(); // no oldself needed
+ SELFCALL(self.owner, ClientKill_Now());
+ SELFCALL_DONE();
return;
}
else if(g_cts && self.health == 1) // health == 1 means that it's silent
{
self.teamkill_soundtime = 0;
- entity oldself = self;
setself(self.teamkill_soundsource);
entity oldpusher = self.pusher;
- self.pusher = oldself;
+ self.pusher = this;
PlayerSound(playersound_teamshoot, CH_VOICE, VOICETYPE_LASTATTACKER_ONLY);
self.pusher = oldpusher;
- setself(oldself);
+ setself(this);
}
if(self.taunt_soundtime)
}
void CopyBody(float keepvelocity)
{SELFPARAM();
- entity oldself;
if (self.effects & EF_NODRAW)
return;
- oldself = self;
setself(spawn());
- self.enemy = oldself;
- self.lip = oldself.lip;
- self.colormap = oldself.colormap;
- self.iscreature = oldself.iscreature;
- self.teleportable = oldself.teleportable;
- self.damagedbycontents = oldself.damagedbycontents;
- self.angles = oldself.angles;
- self.v_angle = oldself.v_angle;
- self.avelocity = oldself.avelocity;
+ self.enemy = this;
+ self.lip = this.lip;
+ self.colormap = this.colormap;
+ self.iscreature = this.iscreature;
+ self.teleportable = this.teleportable;
+ self.damagedbycontents = this.damagedbycontents;
+ self.angles = this.angles;
+ self.v_angle = this.v_angle;
+ self.avelocity = this.avelocity;
self.classname = "body";
- self.damageforcescale = oldself.damageforcescale;
- self.effects = oldself.effects;
- self.glowmod = oldself.glowmod;
- self.event_damage = oldself.event_damage;
- self.anim_state = oldself.anim_state;
- self.anim_time = oldself.anim_time;
- self.anim_lower_action = oldself.anim_lower_action;
- self.anim_lower_time = oldself.anim_lower_time;
- self.anim_upper_action = oldself.anim_upper_action;
- self.anim_upper_time = oldself.anim_upper_time;
- self.anim_implicit_state = oldself.anim_implicit_state;
- self.anim_implicit_time = oldself.anim_implicit_time;
- self.anim_lower_implicit_action = oldself.anim_lower_implicit_action;
- self.anim_lower_implicit_time = oldself.anim_lower_implicit_time;
- self.anim_upper_implicit_action = oldself.anim_upper_implicit_action;
- self.anim_upper_implicit_time = oldself.anim_upper_implicit_time;
- self.dphitcontentsmask = oldself.dphitcontentsmask;
- self.death_time = oldself.death_time;
- self.pain_finished = oldself.pain_finished;
- self.health = oldself.health;
- self.armorvalue = oldself.armorvalue;
- self.armortype = oldself.armortype;
- self.model = oldself.model;
- self.modelindex = oldself.modelindex;
- self.skin = oldself.skin;
- self.species = oldself.species;
- self.movetype = oldself.movetype;
- self.solid = oldself.solid;
- self.ballistics_density = oldself.ballistics_density;
- self.takedamage = oldself.takedamage;
- self.customizeentityforclient = oldself.customizeentityforclient;
- self.uncustomizeentityforclient = oldself.uncustomizeentityforclient;
- self.uncustomizeentityforclient_set = oldself.uncustomizeentityforclient_set;
+ self.damageforcescale = this.damageforcescale;
+ self.effects = this.effects;
+ self.glowmod = this.glowmod;
+ self.event_damage = this.event_damage;
+ self.anim_state = this.anim_state;
+ self.anim_time = this.anim_time;
+ self.anim_lower_action = this.anim_lower_action;
+ self.anim_lower_time = this.anim_lower_time;
+ self.anim_upper_action = this.anim_upper_action;
+ self.anim_upper_time = this.anim_upper_time;
+ self.anim_implicit_state = this.anim_implicit_state;
+ self.anim_implicit_time = this.anim_implicit_time;
+ self.anim_lower_implicit_action = this.anim_lower_implicit_action;
+ self.anim_lower_implicit_time = this.anim_lower_implicit_time;
+ self.anim_upper_implicit_action = this.anim_upper_implicit_action;
+ self.anim_upper_implicit_time = this.anim_upper_implicit_time;
+ self.dphitcontentsmask = this.dphitcontentsmask;
+ self.death_time = this.death_time;
+ self.pain_finished = this.pain_finished;
+ self.health = this.health;
+ self.armorvalue = this.armorvalue;
+ self.armortype = this.armortype;
+ self.model = this.model;
+ self.modelindex = this.modelindex;
+ self.skin = this.skin;
+ self.species = this.species;
+ self.movetype = this.movetype;
+ self.solid = this.solid;
+ self.ballistics_density = this.ballistics_density;
+ self.takedamage = this.takedamage;
+ self.customizeentityforclient = this.customizeentityforclient;
+ self.uncustomizeentityforclient = this.uncustomizeentityforclient;
+ self.uncustomizeentityforclient_set = this.uncustomizeentityforclient_set;
if (keepvelocity == 1)
- self.velocity = oldself.velocity;
+ self.velocity = this.velocity;
self.oldvelocity = self.velocity;
- self.alpha = oldself.alpha;
- self.fade_time = oldself.fade_time;
- self.fade_rate = oldself.fade_rate;
- //self.weapon = oldself.weapon;
- setorigin(self, oldself.origin);
- setsize(self, oldself.mins, oldself.maxs);
- self.prevorigin = oldself.origin;
+ self.alpha = this.alpha;
+ self.fade_time = this.fade_time;
+ self.fade_rate = this.fade_rate;
+ //self.weapon = this.weapon;
+ setorigin(self, this.origin);
+ setsize(self, this.mins, this.maxs);
+ self.prevorigin = this.origin;
self.reset = SUB_Remove;
- Drag_MoveDrag(oldself, self);
+ Drag_MoveDrag(this, self);
if(self.colormap <= maxclients && self.colormap > 0)
- self.colormap = 1024 + oldself.clientcolors;
+ self.colormap = 1024 + this.clientcolors;
CSQCMODEL_AUTOINIT(self);
- self.CopyBody_nextthink = oldself.nextthink;
- self.CopyBody_think = oldself.think;
+ self.CopyBody_nextthink = this.nextthink;
+ self.CopyBody_think = this.think;
self.nextthink = time;
self.think = CopyBody_Think;
// "bake" the current animation frame for clones (they don't get clientside animation)
animdecide_load_if_needed(self);
animdecide_setframes(self, false, frame, frame1time, frame2, frame2time);
- setself(oldself);
+ setself(this);
}
float player_getspecies()
if (gameover || targ.killcount == -666)
return;
- entity oldself = self;
setself(targ);
damage_targ = targ;
damage_inflictor = inflictor;
if(IS_PLAYER(targ))
if(SAME_TEAM(targ, attacker))
{
- setself(oldself);
+ setself(this);
return;
}
}
{
Send_Effect(EFFECT_TELEPORT, targ.origin, '0 0 0', 1);
- entity oldself = self;
setself(targ);
entity spot = SelectSpawnPoint (false);
Send_Effect(EFFECT_TELEPORT, self.origin, '0 0 0', 1);
}
- setself(oldself);
+ setself(this);
}
if(!g_instagib)
if (damage != 0 || (self.damageforcescale && vlen(force)))
if (self.event_damage)
self.event_damage (inflictor, attacker, damage, deathtype, hitloc, force);
- setself(oldself);
+ setself(this);
// apply mirror damage if any
if(mirrordamage > 0 || mirrorforce > 0)
PlayerTeamScore_Add(activator, SP_ASSAULT_OBJECTIVES, ST_ASSAULT_OBJECTIVES, 1);
self.enemy.health = -1;
- entity oldself, oldactivator, head;
+ entity oldactivator, head;
- oldself = self;
- setself(oldself.enemy);
+ setself(this.enemy);
if(self.message)
FOR_EACH_PLAYER(head)
centerprint(head, self.message);
oldactivator = activator;
- activator = oldself;
+ activator = this;
SUB_UseTargets();
activator = oldactivator;
- setself(oldself);
+ setself(this);
}
}
}
self.health = 0;
ctf_CheckFlagReturn(self, RETURN_SPEEDRUN);
- tmp_entity = self;
setself(self.owner);
self.impulse = CHIMPULSE_SPEEDRUN; // move the player back to the waypoint they set
ImpulseCommands();
- setself(tmp_entity);
+ setself(this);
}
if(autocvar_g_ctf_stalemate)
{
// code from here on is just to support maps that don't have flag and team entities
void ctf_SpawnTeam (string teamname, int teamcolor)
{SELFPARAM();
- entity oldself = self;
setself(spawn());
self.classname = "ctf_team";
self.netname = teamname;
spawnfunc_ctf_team();
- setself(oldself);
+ setself(this);
}
void ctf_DelayedInit() // Do this check with a delay so we can wait for teams to be set up.
// 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 = self;
setself(spawn());
self.classname = "dom_team";
self.netname = teamname;
self.team = self.cnt + 1;
//eprint(self);
- setself(oldself);
+ setself(this);
}
void dom_spawnpoint(vector org)
{SELFPARAM();
- entity oldself = self;
setself(spawn());
self.classname = "dom_controlpoint";
self.think = spawnfunc_dom_controlpoint;
self.nextthink = time;
setorigin(self, org);
spawnfunc_dom_controlpoint();
- setself(oldself);
+ setself(this);
}
// spawn some default teams if the map is not set up for domination
void nexball_setstatus(void)
{SELFPARAM();
- entity oldself;
self.items &= ~IT_KEY1;
if(self.ballcarried)
{
if(self.ballcarried.teamtime && (self.ballcarried.teamtime < time))
{
bprint("The ", Team_ColoredFullName(self.team), " held the ball for too long.\n");
- oldself = self;
setself(self.ballcarried);
DropBall(self, self.owner.origin, '0 0 0');
ResetBall();
- setself(oldself);
+ setself(this);
}
else
self.items |= IT_KEY1;
ball.nextthink = time + autocvar_g_nexball_basketball_delay_hold;
}
- ownr = self;
+ plyr.weaponentity.weapons = plyr.weapons;
+ plyr.weaponentity.switchweapon = plyr.weapon;
+ plyr.weapons = WEPSET_PORTO;
setself(plyr);
- self.weaponentity.weapons = self.weapons;
- self.weaponentity.switchweapon = self.weapon;
- self.weapons = WEPSET_PORTO;
WEP_ACTION(WEP_PORTO.m_id, WR_RESETPLAYER);
- self.switchweapon = WEP_PORTO.m_id;
+ plyr.switchweapon = WEP_PORTO.m_id;
W_SwitchWeapon(WEP_PORTO.m_id);
- setself(ownr);
+ setself(this);
}
void DropBall(entity ball, vector org, vector vel)
void ons_ControlPoint_Icon_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{SELFPARAM();
- entity oself;
-
if(damage <= 0) { return; }
if (self.owner.isshielded)
onslaught_updatelinks();
// Use targets now (somebody make sure this is in the right place..)
- oself = self;
setself(self.owner);
activator = self;
SUB_UseTargets ();
- setself(oself);
+ setself(this);
self.owner.waslinked = self.owner.islinked;
if(self.owner.model != "models/onslaught/controlpoint_pad.md3")
void ons_ControlPoint_Icon_Think()
{SELFPARAM();
- entity oself;
self.nextthink = time + ONS_CP_THINKRATE;
if(autocvar_g_onslaught_cp_proxydecap)
if(!self.owner.islinked)
self.owner.team = 0;
- oself = self;
setself(self.owner);
activator = self;
SUB_UseTargets ();
- setself(oself);
+ setself(this);
self.owner.team = t;
void ons_ControlPoint_Icon_BuildThink()
{SELFPARAM();
- entity oself;
int a;
self.nextthink = time + ONS_CP_THINKRATE;
onslaught_updatelinks();
// Use targets now (somebody make sure this is in the right place..)
- oself = self;
setself(self.owner);
activator = self;
SUB_UseTargets ();
- setself(oself);
+ setself(this);
self.SendFlags |= CPSF_SETUP;
}
MUTATOR_HOOKFUNCTION(ok_PlayerDies)
{SELFPARAM();
- entity oldself = self;
entity targ = ((frag_attacker) ? frag_attacker : frag_target);
if(IS_MONSTER(self))
self.velocity = '0 0 200' + normalize(targ.origin - self.origin) * 500;
self.classname = "droppedweapon"; // hax
SUB_SetFade(self, time + 5, 1);
- setself(oldself);
+ setself(this);
self.ok_lastwep = self.switchweapon;
MUTATOR_HOOKFUNCTION(superspec_ItemTouch)
{SELFPARAM();
- entity _oldself = self;
entity _item = self;
entity e;
{
_spectate(other);
- setself(_oldself);
+ setself(this);
return MUT_ITEMTOUCH_CONTINUE;
}
}
}
}
- setself(_oldself);
+ setself(this);
return MUT_ITEMTOUCH_CONTINUE;
}
float have_verified;
void trigger_race_checkpoint_verify()
{SELFPARAM();
- entity oldself, cp;
+ entity cp;
float i, p;
float qual;
qual = g_race_qualifying;
- oldself = self;
setself(spawn());
self.classname = "player";
}
}
remove(self);
- setself(oldself);
+ setself(this);
}
vector trigger_race_checkpoint_spawn_evalfunc(entity player, entity spot, vector current)
if(self.waypointsprite_attached)
{
- entity e;
- entity it = self;
setself(self.waypointsprite_attached);
+ entity e;
FOR_EACH_REALCLIENT(e)
if(self.waypointsprite_visible_for_player(e))
{
msg_entity = e;
- soundto(MSG_ONE, it, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTEN_NORM); // play respawn sound
+ soundto(MSG_ONE, this, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTEN_NORM); // play respawn sound
}
- setself(it);
+ setself(this);
WaypointSprite_Ping(self.waypointsprite_attached);
//WaypointSprite_UpdateHealth(self.waypointsprite_attached, self.count);
float client_hasweapon(entity cl, float wpn, float andammo, float complain)
{SELFPARAM();
float f;
- entity oldself;
if(time < self.hasweapon_complain_spam)
complain = 0;
}
else
{
- oldself = self;
setself(cl);
f = WEP_ACTION(wpn, WR_CHECKAMMO1);
f = f + WEP_ACTION(wpn, WR_CHECKAMMO2);
for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.owner == self)
f = 1;
- setself(oldself);
+ setself(this);
}
if (!f)
{
entity e;
float t;
string s;
- entity oldself;
float i, j;
int f;
if(t >= 2)
{
self.team = --internalteam;
- oldself = self;
for(i = 1; i < t; ++i)
{
s = argv(i);
if(e.netname == s)
{
setself(spawn());
- copyentity(oldself, self);
+ copyentity(this, self);
self.classname = "replacedweapon";
weapon_defaultspawnfunc(j);
break;
}
if(j > WEP_LAST)
{
- LOG_INFO("The weapon replace list for ", oldself.classname, " contains an unknown weapon ", s, ". Skipped.\n");
+ LOG_INFO("The weapon replace list for ", this.classname, " contains an unknown weapon ", s, ". Skipped.\n");
}
}
- setself(oldself);
+ setself(this);
}
if(t >= 1) // always the case!
{
void WarpZone_Touch (void)
{SELFPARAM();
- entity oldself;
-
if(other.classname == "trigger_warpzone")
return;
if (!self.target) self.target = save1;
if (!self.target3) self.target3 = save2;
- oldself = self;
setself(self.enemy);
save1 = self.target; self.target = string_null;
save2 = self.target2; self.target2 = string_null;
SUB_UseTargets();
if (!self.target) self.target = save1;
if (!self.target2) self.target2 = save2;
- setself(oldself);
+ setself(this);
}
else
{
|| self.warpzone_save_eorigin != self.enemy.origin
|| self.warpzone_save_eangles != self.enemy.angles)
{
- entity oldself;
- oldself = self;
WarpZone_InitStep_UpdateTransform();
setself(self.enemy);
WarpZone_InitStep_UpdateTransform();
- setself(oldself);
+ setself(this);
WarpZone_InitStep_FinalizeTransform();
setself(self.enemy);
WarpZone_InitStep_FinalizeTransform();
- setself(oldself);
+ setself(this);
self.warpzone_save_origin = self.origin;
self.warpzone_save_angles = self.angles;
self.warpzone_save_eorigin = self.enemy.origin;
WarpZone_PostInitialize_Callback();
}
- entity oldself, oldother;
- oldself = self;
+ entity oldother;
oldother = other;
for(e = world; (e = nextent(e)); )
{
break;
}
}
- setself(oldself);
+ setself(this);
other = oldother;
}