From: TimePath Date: Sat, 28 May 2016 11:06:01 +0000 (+1000) Subject: Remove various SELFPARAM X-Git-Tag: xonotic-v0.8.2~892 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1a9e7607796f021c85d200ce66bdfb7f3932d882;p=xonotic%2Fxonotic-data.pk3dir.git Remove various SELFPARAM --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index f96998592..e00bdddf2 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -1360,7 +1360,8 @@ int lasthud; float vh_notice_time; void WaypointSprite_Load(); void CSQC_UpdateView(float w, float h) -{SELFPARAM(); +{ + SELFPARAM(); TC(int, w); TC(int, h); entity e; float fov; diff --git a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc index afa6db93f..cb9e3f165 100644 --- a/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc +++ b/qcsrc/common/gamemodes/gamemode/nexball/nexball.qc @@ -725,7 +725,7 @@ void W_Nexball_Touch(entity this) //self.think = func_null; //self.enemy = world; - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); if(attacker.team != other.team || autocvar_g_nexball_basketball_teamsteal) if((ball = other.ballcarried) && !STAT(FROZEN, other) && !IS_DEAD(other) && (IS_PLAYER(attacker))) { diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index 50e906130..5b7bf3a56 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -162,7 +162,7 @@ void M_Mage_Attack_Spike_Explode(entity this) void M_Mage_Attack_Spike_Touch(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); M_Mage_Attack_Spike_Explode(self); } diff --git a/qcsrc/common/monsters/monster/shambler.qc b/qcsrc/common/monsters/monster/shambler.qc index c2e13883c..2e9384dc2 100644 --- a/qcsrc/common/monsters/monster/shambler.qc +++ b/qcsrc/common/monsters/monster/shambler.qc @@ -126,7 +126,7 @@ void M_Shambler_Attack_Lightning_Damage(entity this, entity inflictor, entity at void M_Shambler_Attack_Lightning_Touch(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); self.use(this, NULL, NULL); } diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index 281accb14..b9f9bfc21 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -158,7 +158,7 @@ void M_Spider_Attack_Web_Explode_use(entity this, entity actor, entity trigger) void M_Spider_Attack_Web_Touch(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); M_Spider_Attack_Web_Explode(); } diff --git a/qcsrc/common/monsters/monster/wyvern.qc b/qcsrc/common/monsters/monster/wyvern.qc index a0e670507..ae8e8751d 100644 --- a/qcsrc/common/monsters/monster/wyvern.qc +++ b/qcsrc/common/monsters/monster/wyvern.qc @@ -118,7 +118,7 @@ void M_Wyvern_Attack_Fireball_Explode(entity this) void M_Wyvern_Attack_Fireball_Touch(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); M_Wyvern_Attack_Fireball_Explode(this); } diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index a6a2f7228..4e339cea0 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -724,7 +724,7 @@ void nade_touch(entity this) return; } - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); //setsize(self, '-2 -2 -2', '2 2 2'); //UpdateCSQCProjectile(self); diff --git a/qcsrc/common/mutators/mutator/overkill/rpc.qc b/qcsrc/common/mutators/mutator/overkill/rpc.qc index 145817272..b3b8f4248 100644 --- a/qcsrc/common/mutators/mutator/overkill/rpc.qc +++ b/qcsrc/common/mutators/mutator/overkill/rpc.qc @@ -62,8 +62,8 @@ void W_RocketPropelledChainsaw_Explode(entity this) void W_RocketPropelledChainsaw_Touch (entity this) { - if(WarpZone_Projectile_Touch()) - if(wasfreed(self)) + if(WarpZone_Projectile_Touch(this)) + if(wasfreed(this)) return; W_RocketPropelledChainsaw_Explode(this); diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 60ee6c866..656d829a9 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -484,8 +484,8 @@ float Item_ItemsTime_UpdateTime(entity e, float t); void Item_ItemsTime_SetTime(entity e, float t); void Item_ItemsTime_SetTimesForAllPlayers(); -void Item_Respawn () -{SELFPARAM(); +void Item_Respawn (entity this) +{ Item_Show(self, 1); // this is ugly... if(self.items == ITEM_Strength.m_itemid) @@ -516,7 +516,7 @@ void Item_RespawnCountdown (entity this) { if(self.waypointsprite_attached) WaypointSprite_Kill(self.waypointsprite_attached); - Item_Respawn(); + Item_Respawn(self); } else { @@ -575,7 +575,7 @@ void Item_RespawnThink(entity this) ItemUpdate(self); if(time >= self.wait) - Item_Respawn(); + Item_Respawn(self); } void Item_ScheduleRespawnIn(entity e, float t) @@ -858,7 +858,6 @@ void Item_Reset(entity this) Item_ScheduleInitialRespawn(this); } } -void Item_Reset_self() { SELFPARAM(); Item_Reset(this); } void Item_FindTeam(entity this) { @@ -1634,7 +1633,7 @@ void GiveRot(entity e, float v0, float v1, .float rotfield, float rottime, .floa e.(regenfield) = max(e.(regenfield), time + regentime); } float GiveItems(entity e, float beginarg, float endarg) -{SELFPARAM(); +{ float got, i, val, op; float _switchweapon; string cmd; @@ -1796,7 +1795,7 @@ float GiveItems(entity e, float beginarg, float endarg) POSTGIVE_VALUE_ROT(e, health, 1, pauserothealth_finished, autocvar_g_balance_pause_health_rot, pauseregen_finished, autocvar_g_balance_pause_health_regen, SND_MEGAHEALTH, SND_Null); if(e.superweapons_finished <= 0) - if(self.weapons & WEPSET_SUPERWEAPONS) + if(e.weapons & WEPSET_SUPERWEAPONS) e.superweapons_finished = autocvar_g_balance_superweapons_time; if(e.strength_finished <= 0) diff --git a/qcsrc/common/t_items.qh b/qcsrc/common/t_items.qh index 3ba0a0deb..5ebc9d7e6 100644 --- a/qcsrc/common/t_items.qh +++ b/qcsrc/common/t_items.qh @@ -72,7 +72,7 @@ const float ITEM_RESPAWN_TICKS = 10; void Item_Show (entity e, float mode); -void Item_Respawn (); +void Item_Respawn (entity this); void Item_RespawnCountdown(entity this); void Item_ScheduleRespawnIn(entity e, float t); diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index 66b3f3dbb..769c0edf7 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -445,7 +445,7 @@ void turret_projectile_explode(entity this) void turret_projectile_touch(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); turret_projectile_explode(this); } diff --git a/qcsrc/common/turrets/turret/ewheel.qc b/qcsrc/common/turrets/turret/ewheel.qc index 40603cca0..113431003 100644 --- a/qcsrc/common/turrets/turret/ewheel.qc +++ b/qcsrc/common/turrets/turret/ewheel.qc @@ -54,7 +54,7 @@ void ewheel_move_path() if (self.pathgoal.enemy) { - self.pathcurrent = pathlib_astar(self.pathgoal.origin,self.pathgoal.enemy.origin); + self.pathcurrent = pathlib_astar(self, self.pathgoal.origin,self.pathgoal.enemy.origin); self.pathgoal = self.pathgoal.enemy; } } @@ -207,7 +207,7 @@ METHOD(EWheel, tr_setup, void(EWheel this, entity it)) { #ifdef EWHEEL_FANCYPATH - it.pathcurrent = WALKER_PATH(it.origin,e.origin); + it.pathcurrent = WALKER_PATH(it, it.origin, e.origin); it.pathgoal = e; #else it.pathcurrent = e; diff --git a/qcsrc/common/turrets/turret/walker.qc b/qcsrc/common/turrets/turret/walker.qc index de7d282ec..fec4060d4 100644 --- a/qcsrc/common/turrets/turret/walker.qc +++ b/qcsrc/common/turrets/turret/walker.qc @@ -63,7 +63,7 @@ const int ANIM_ROAM = 11; .float animflag; .float idletime; -#define WALKER_PATH(s,e) pathlib_astar(s,e) +#define WALKER_PATH(this, s, e) pathlib_astar(this, s, e) float walker_firecheck() {SELFPARAM(); @@ -317,7 +317,7 @@ void walker_move_path() if (self.pathgoal.enemy) { - self.pathcurrent = WALKER_PATH(self.pathgoal.origin,self.pathgoal.enemy.origin); + self.pathcurrent = WALKER_PATH(self, self.pathgoal.origin, self.pathgoal.enemy.origin); self.pathgoal = self.pathgoal.enemy; } } @@ -617,7 +617,7 @@ METHOD(WalkerTurret, tr_setup, void(WalkerTurret this, entity it)) else { #ifdef WALKER_FANCYPATHING - it.pathcurrent = WALKER_PATH(it.origin, e.origin); + it.pathcurrent = WALKER_PATH(it, it.origin, e.origin); it.pathgoal = e; #else it.pathcurrent = e; diff --git a/qcsrc/common/util.qc b/qcsrc/common/util.qc index ec643fcb5..521101372 100644 --- a/qcsrc/common/util.qc +++ b/qcsrc/common/util.qc @@ -57,22 +57,25 @@ string wordwrap(string s, float l) #ifndef MENUQC #ifndef CSQC +entity _wordwrap_buffer_sprint_ent; void wordwrap_buffer_sprint(string s) -{SELFPARAM(); +{ wordwrap_buffer = strcat(wordwrap_buffer, s); if(s == "\n") { - sprint(self, wordwrap_buffer); + sprint(_wordwrap_buffer_sprint_ent, wordwrap_buffer); wordwrap_buffer = ""; } } -void wordwrap_sprint(string s, float l) -{SELFPARAM(); +void wordwrap_sprint(entity to, string s, float l) +{ wordwrap_buffer = ""; + _wordwrap_buffer_sprint_ent = to; wordwrap_cb(s, l, wordwrap_buffer_sprint); + _wordwrap_buffer_sprint_ent = NULL; if(wordwrap_buffer != "") - sprint(self, strcat(wordwrap_buffer, "\n")); + sprint(to, strcat(wordwrap_buffer, "\n")); wordwrap_buffer = ""; return; } diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh index 066033a17..fa17a06a3 100644 --- a/qcsrc/common/util.qh +++ b/qcsrc/common/util.qh @@ -11,7 +11,7 @@ vector real_origin(entity ent); string wordwrap(string s, float l); #ifndef MENUQC #ifndef CSQC -void wordwrap_sprint(string s, float l); +void wordwrap_sprint(entity to, string s, float l); #endif #endif void wordwrap_cb(string s, float l, void(string) callback); diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 19b71a0ce..6f1d2d918 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -224,7 +224,7 @@ void vehicles_projectile_explode(entity this) return; } - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); self.event_damage = func_null; RadiusDamage (self, self.realowner, self.shot_dmg, 0, self.shot_radius, self, world, self.shot_force, self.totalfrags, other); diff --git a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc index c2c266f00..fc439734c 100644 --- a/qcsrc/common/vehicles/vehicle/raptor_weapons.qc +++ b/qcsrc/common/vehicles/vehicle/raptor_weapons.qc @@ -99,7 +99,7 @@ void raptor_bomblet_touch(entity this) if(other == self.owner) return; - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); setthink(self, raptor_bomblet_boom); self.nextthink = time + random() * autocvar_g_vehicle_raptor_bomblet_explode_delay; } diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index e2936bd95..5df635f77 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -261,7 +261,7 @@ void W_Arc_Bolt_Damage(entity this, entity inflictor, entity attacker, float dam void W_Arc_Bolt_Touch(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); self.use(this, NULL, NULL); } diff --git a/qcsrc/common/weapons/weapon/blaster.qc b/qcsrc/common/weapons/weapon/blaster.qc index 5b583c1ac..394d50c69 100644 --- a/qcsrc/common/weapons/weapon/blaster.qc +++ b/qcsrc/common/weapons/weapon/blaster.qc @@ -58,7 +58,7 @@ spawnfunc(weapon_laser) { spawnfunc_weapon_blaster(this); } void W_Blaster_Touch(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); self.event_damage = func_null; diff --git a/qcsrc/common/weapons/weapon/crylink.qc b/qcsrc/common/weapons/weapon/crylink.qc index fb24bcfdf..a582f9843 100644 --- a/qcsrc/common/weapons/weapon/crylink.qc +++ b/qcsrc/common/weapons/weapon/crylink.qc @@ -298,7 +298,7 @@ void W_Crylink_Touch(entity this) float finalhit; float f; float isprimary = !(self.projectiledeathtype & HITTYPE_SECONDARY); - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); float a; a = bound(0, 1 - (time - self.fade_time) * self.fade_rate, 1); diff --git a/qcsrc/common/weapons/weapon/devastator.qc b/qcsrc/common/weapons/weapon/devastator.qc index e04f812be..772b9ea62 100644 --- a/qcsrc/common/weapons/weapon/devastator.qc +++ b/qcsrc/common/weapons/weapon/devastator.qc @@ -322,13 +322,13 @@ void W_Devastator_Think(entity this) void W_Devastator_Touch(entity this) { - if(WarpZone_Projectile_Touch()) + if(WarpZone_Projectile_Touch(this)) { - if(wasfreed(self)) - W_Devastator_Unregister(self); + if(wasfreed(this)) + W_Devastator_Unregister(this); return; } - W_Devastator_Unregister(self); + W_Devastator_Unregister(this); W_Devastator_Explode(this); } diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 37dcf9f07..64a5e06aa 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -198,7 +198,7 @@ void W_Electro_Explode_use(entity this, entity actor, entity trigger) void W_Electro_TouchExplode(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); W_Electro_Explode(this); } @@ -300,7 +300,7 @@ void W_Electro_Attack_Bolt(Weapon thiswep, entity actor) void W_Electro_Orb_Touch(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); if(other.takedamage == DAMAGE_AIM) { if(WEP_CVAR_SEC(electro, touchexplode)) { W_Electro_Explode(self); } } else diff --git a/qcsrc/common/weapons/weapon/fireball.qc b/qcsrc/common/weapons/weapon/fireball.qc index 10a26e444..3ee23e8f5 100644 --- a/qcsrc/common/weapons/weapon/fireball.qc +++ b/qcsrc/common/weapons/weapon/fireball.qc @@ -119,7 +119,7 @@ void W_Fireball_Explode_use(entity this, entity actor, entity trigger) void W_Fireball_TouchExplode(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); W_Fireball_Explode(this); } @@ -292,7 +292,7 @@ void W_Fireball_Firemine_Think(entity this) void W_Fireball_Firemine_Touch(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); if(other.takedamage == DAMAGE_AIM) if(Fire_AddDamage(other, self.realowner, WEP_CVAR_SEC(fireball, damage), WEP_CVAR_SEC(fireball, damagetime), self.projectiledeathtype) >= 0) { diff --git a/qcsrc/common/weapons/weapon/hagar.qc b/qcsrc/common/weapons/weapon/hagar.qc index e2274faaf..577d4cf4e 100644 --- a/qcsrc/common/weapons/weapon/hagar.qc +++ b/qcsrc/common/weapons/weapon/hagar.qc @@ -115,13 +115,13 @@ void W_Hagar_Damage(entity this, entity inflictor, entity attacker, float damage void W_Hagar_Touch(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); this.use(this, NULL, NULL); } void W_Hagar_Touch2(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); if(self.cnt > 0 || other.takedamage == DAMAGE_AIM) { this.use(this, NULL, NULL); diff --git a/qcsrc/common/weapons/weapon/hlac.qc b/qcsrc/common/weapons/weapon/hlac.qc index 928462a20..3fa50ff04 100644 --- a/qcsrc/common/weapons/weapon/hlac.qc +++ b/qcsrc/common/weapons/weapon/hlac.qc @@ -58,7 +58,7 @@ void W_HLAC_Touch(entity this) { float isprimary; - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); self.event_damage = func_null; diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index 40f828f58..7c4aabfe7 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -139,7 +139,7 @@ void W_Hook_Damage(entity this, entity inflictor, entity attacker, float damage, void W_Hook_Touch2(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); this.use(this, NULL, NULL); } diff --git a/qcsrc/common/weapons/weapon/minelayer.qc b/qcsrc/common/weapons/weapon/minelayer.qc index ecb5059b5..bc7f8eb39 100644 --- a/qcsrc/common/weapons/weapon/minelayer.qc +++ b/qcsrc/common/weapons/weapon/minelayer.qc @@ -273,7 +273,7 @@ void W_MineLayer_Touch(entity this) if(self.movetype == MOVETYPE_NONE || self.movetype == MOVETYPE_FOLLOW) return; // we're already a stuck mine, why do we get called? TODO does this even happen? - if(WarpZone_Projectile_Touch()) + if(WarpZone_Projectile_Touch(self)) { if(wasfreed(self)) self.realowner.minelayer_mines -= 1; diff --git a/qcsrc/common/weapons/weapon/mortar.qc b/qcsrc/common/weapons/weapon/mortar.qc index ddff4a35d..843eaa86b 100644 --- a/qcsrc/common/weapons/weapon/mortar.qc +++ b/qcsrc/common/weapons/weapon/mortar.qc @@ -144,7 +144,7 @@ void W_Mortar_Grenade_Think1(entity this) void W_Mortar_Grenade_Touch1(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); if(other.takedamage == DAMAGE_AIM || WEP_CVAR_PRI(mortar, type) == 0) // always explode when hitting a player, or if normal mortar projectile { this.use(this, NULL, NULL); @@ -176,7 +176,7 @@ void W_Mortar_Grenade_Touch1(entity this) void W_Mortar_Grenade_Touch2(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); if(other.takedamage == DAMAGE_AIM || WEP_CVAR_SEC(mortar, type) == 0) // always explode when hitting a player, or if normal mortar projectile { this.use(this, NULL, NULL); diff --git a/qcsrc/common/weapons/weapon/seeker.qc b/qcsrc/common/weapons/weapon/seeker.qc index 5af840505..085255551 100644 --- a/qcsrc/common/weapons/weapon/seeker.qc +++ b/qcsrc/common/weapons/weapon/seeker.qc @@ -104,7 +104,7 @@ void W_Seeker_Missile_Explode(entity this) void W_Seeker_Missile_Touch(entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); W_Seeker_Missile_Explode(this); } @@ -498,7 +498,7 @@ void W_Seeker_Tag_Touch(entity this) vector org2; entity e; - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); dir = normalize(self.realowner.origin - self.origin); org2 = findbetterlocation(self.origin, 8); diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index 4fd81eb30..c4672e727 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -234,7 +234,7 @@ void W_RocketMinsta_Laser_Explode_use(entity this, entity actor, entity trigger) void W_RocketMinsta_Laser_Touch (entity this) { - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); //W_RocketMinsta_Laser_Explode (); RadiusDamage (self, self.realowner, self.rm_damage, self.rm_edmg, autocvar_g_rm_laser_radius, world, world, self.rm_force, self.projectiledeathtype, other); remove(self); diff --git a/qcsrc/lib/csqcmodel/sv_model.qc b/qcsrc/lib/csqcmodel/sv_model.qc index dc2e4021f..b02df19e0 100644 --- a/qcsrc/lib/csqcmodel/sv_model.qc +++ b/qcsrc/lib/csqcmodel/sv_model.qc @@ -30,9 +30,8 @@ // generic CSQC model code -bool CSQCModel_Send(entity to, int sf) +bool CSQCModel_Send(entity this, entity to, int sf) { - SELFPARAM(); // some nice flags for CSQCMODEL_IF noref bool isplayer = IS_CLIENT(this); noref bool islocalplayer = (this == to); @@ -122,7 +121,8 @@ void CSQCModel_CheckUpdate(entity e) void CSQCModel_LinkEntity(entity e) { - e.SendEntity = CSQCModel_Send; + e.SendEntity = SendEntity_self; + e.SendEntity3 = CSQCModel_Send; e.SendFlags = 0xFFFFFF; CSQCModel_CheckUpdate(e); } @@ -130,4 +130,5 @@ void CSQCModel_LinkEntity(entity e) void CSQCModel_UnlinkEntity(entity e) { e.SendEntity = func_null; + e.SendEntity3 = func_null; } diff --git a/qcsrc/lib/warpzone/server.qc b/qcsrc/lib/warpzone/server.qc index c8a241f97..0fb8dd235 100644 --- a/qcsrc/lib/warpzone/server.qc +++ b/qcsrc/lib/warpzone/server.qc @@ -363,7 +363,7 @@ bool WarpZone_Camera_Send(entity this, entity to, int sendflags) #ifdef WARPZONELIB_KEEPDEBUG float WarpZone_CheckProjectileImpact(entity player) -{SELFPARAM(); +{ vector o0, v0; .vector orgvec, velvec; @@ -435,8 +435,8 @@ float WarpZone_CheckProjectileImpact(entity player) #endif #endif -float WarpZone_Projectile_Touch() -{SELFPARAM(); +float WarpZone_Projectile_Touch(entity this) +{ if(other.classname == "trigger_warpzone") return true; @@ -479,9 +479,8 @@ float WarpZone_Projectile_Touch() save_ent = trace_ent; save_inopen = trace_inopen; save_inwater = trace_inwater; - float f; - if((f = WarpZone_CheckProjectileImpact(this)) != 0) - return (f > 0); + float f = WarpZone_CheckProjectileImpact(this); + if (f) return (f > 0); trace_dpstartcontents = save_dpstartcontents; trace_dphitcontents = save_dphitcontents; trace_dphitq3surfaceflags = save_dphitq3surfaceflags; diff --git a/qcsrc/lib/warpzone/server.qh b/qcsrc/lib/warpzone/server.qh index db0ba59cc..c6c7b9840 100644 --- a/qcsrc/lib/warpzone/server.qh +++ b/qcsrc/lib/warpzone/server.qh @@ -3,7 +3,7 @@ #ifdef SVQC void WarpZone_StartFrame(); -float WarpZone_Projectile_Touch(); +float WarpZone_Projectile_Touch(entity this); // THESE must be defined by calling QC code: void WarpZone_PostTeleportPlayer_Callback(entity pl); diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 2ddeb6391..0d59fa6e4 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -807,7 +807,7 @@ void havocbot_movetogoal(entity this) this.aistatus |= AI_STATUS_DANGER_AHEAD; } - dodge = havocbot_dodge(); + dodge = havocbot_dodge(this); dodge = dodge * bound(0,0.5+(skill+this.bot_dodgeskill)*0.1,1); evadelava = evadelava * bound(1,3-(skill+this.bot_dodgeskill),3); //Noobs fear lava a lot and take more distance from it traceline(this.origin, ( ( this.enemy.absmin + this.enemy.absmax ) * 0.5 ), true, world); @@ -1268,12 +1268,11 @@ void havocbot_setupbot(entity this) havocbot_chooserole(this); } -vector havocbot_dodge() +vector havocbot_dodge(entity this) { // LordHavoc: disabled because this is too expensive return '0 0 0'; #if 0 -SELFPARAM(); entity head; vector dodge, v, n; float danger, bestdanger, vl, d; diff --git a/qcsrc/server/bot/havocbot/havocbot.qh b/qcsrc/server/bot/havocbot/havocbot.qh index 36b4c33fd..4a391b6e7 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qh +++ b/qcsrc/server/bot/havocbot/havocbot.qh @@ -47,7 +47,7 @@ float havocbot_resetgoal(entity this); float havocbot_moveto(entity this, vector pos); float havocbot_moveto_refresh_route(entity this); -vector havocbot_dodge(); +vector havocbot_dodge(entity this); .void(entity this) havocbot_role; .void(entity this) havocbot_previous_role; diff --git a/qcsrc/server/command/common.qc b/qcsrc/server/command/common.qc index 5bacd0d87..14f7439a4 100644 --- a/qcsrc/server/command/common.qc +++ b/qcsrc/server/command/common.qc @@ -183,14 +183,13 @@ void print_to(entity to, string input) // ========================================== // used by CommonCommand_timeout() and CommonCommand_timein() to handle game pausing and messaging and such. -void timeout_handler_reset() +void timeout_handler_reset(entity this) { - SELFPARAM(); - timeout_caller = world; + timeout_caller = NULL; timeout_time = 0; timeout_leadtime = 0; - remove(self); + remove(this); } void timeout_handler_think(entity this) @@ -221,7 +220,7 @@ void timeout_handler_think(entity this) it.fixangle = false; )); - timeout_handler_reset(); + timeout_handler_reset(this); } return; @@ -265,7 +264,7 @@ void timeout_handler_think(entity this) case TIMEOUT_INACTIVE: default: { - timeout_handler_reset(); + timeout_handler_reset(this); return; } } @@ -472,7 +471,7 @@ void CommonCommand_info(float request, entity caller, float argc) { string command = builtin_cvar_string(strcat("sv_info_", argv(1))); - if (command) wordwrap_sprint(command, 1000); + if (command) wordwrap_sprint(caller, command, 1000); else print_to(caller, "ERROR: unsupported info command"); return; // never fall through to usage diff --git a/qcsrc/server/command/common.qh b/qcsrc/server/command/common.qh index a45d91343..63b1c708f 100644 --- a/qcsrc/server/command/common.qh +++ b/qcsrc/server/command/common.qh @@ -98,7 +98,7 @@ void print_to(entity to, string input); // ========================================== // used by CommonCommand_timeout() and CommonCommand_timein() to handle game pausing and messaging and such. -void timeout_handler_reset(); +void timeout_handler_reset(entity this); void timeout_handler_think(entity this); diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index 3be5e6667..1b5e22bee 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -305,7 +305,7 @@ void GrapplingHookTouch (entity this) { if(other.movetype == MOVETYPE_FOLLOW) return; - PROJECTILE_TOUCH; + PROJECTILE_TOUCH(this); GrapplingHook_Stop(); diff --git a/qcsrc/server/miscfunctions.qh b/qcsrc/server/miscfunctions.qh index 634d3fb64..2d52916b1 100644 --- a/qcsrc/server/miscfunctions.qh +++ b/qcsrc/server/miscfunctions.qh @@ -122,7 +122,7 @@ void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomo #define ITEM_TOUCH_NEEDKILL() (((trace_dpstartcontents | trace_dphitcontents) & DPCONTENTS_NODROP) || (trace_dphitq3surfaceflags & Q3SURFACEFLAG_SKY)) #define ITEM_DAMAGE_NEEDKILL(dt) (((dt) == DEATH_HURTTRIGGER.m_id) || ((dt) == DEATH_SLIME.m_id) || ((dt) == DEATH_LAVA.m_id) || ((dt) == DEATH_SWAMP.m_id)) -#define PROJECTILE_TOUCH if(WarpZone_Projectile_Touch()) return +#define PROJECTILE_TOUCH(this) MACRO_BEGIN if (WarpZone_Projectile_Touch(this)) return; MACRO_END #define CENTER_OR_VIEWOFS(ent) (ent.origin + (IS_PLAYER(ent) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5))) diff --git a/qcsrc/server/pathlib/debug.qc b/qcsrc/server/pathlib/debug.qc index 15a845c5a..09b81724e 100644 --- a/qcsrc/server/pathlib/debug.qc +++ b/qcsrc/server/pathlib/debug.qc @@ -23,10 +23,10 @@ void pathlib_showpath(entity start) } } -void path_dbg_think() -{SELFPARAM(); - pathlib_showpath(self); - self.nextthink = time + 1; +void path_dbg_think(entity this) +{ + pathlib_showpath(this); + this.nextthink = time + 1; } void __showpath2_think(entity this) diff --git a/qcsrc/server/pathlib/main.qc b/qcsrc/server/pathlib/main.qc index b3ae090fb..c033f3f52 100644 --- a/qcsrc/server/pathlib/main.qc +++ b/qcsrc/server/pathlib/main.qc @@ -379,8 +379,8 @@ entity path_build(entity next, vector where, entity prev, entity start) return path; } -entity pathlib_astar(vector from,vector to) -{SELFPARAM(); +entity pathlib_astar(entity this, vector from,vector to) +{ entity path, start, end, open, n, ln; float ptime, ftime, ctime; @@ -442,8 +442,8 @@ entity pathlib_astar(vector from,vector to) pathlib_movecost_waterfactor = 25000000; pathlib_foundgoal = 0; - movenode_boxmax = self.maxs * 1.1; - movenode_boxmin = self.mins * 1.1; + movenode_boxmax = this.maxs * 1.1; + movenode_boxmin = this.mins * 1.1; movenode_stepsize = pathlib_gridsize * 0.25;