From: Mario Date: Fri, 10 Jun 2016 12:07:16 +0000 (+1000) Subject: Clean out some more SELFPARAMs X-Git-Tag: xonotic-v0.8.2~849 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0a20a065f61e6235f62801362a25dfb0a70c6a14;p=xonotic%2Fxonotic-data.pk3dir.git Clean out some more SELFPARAMs --- diff --git a/qcsrc/common/triggers/func/breakable.qc b/qcsrc/common/triggers/func/breakable.qc index d4abe5b81..9bbdfd48b 100644 --- a/qcsrc/common/triggers/func/breakable.qc +++ b/qcsrc/common/triggers/func/breakable.qc @@ -319,7 +319,7 @@ spawnfunc(func_breakable) this.dmg_force = 200; this.mdl = this.model; - WITHSELF(this, SetBrushEntityModel()); + SetBrushEntityModel(this); if(this.spawnflags & 4) this.use = func_breakable_destroy; diff --git a/qcsrc/common/triggers/func/rainsnow.qc b/qcsrc/common/triggers/func/rainsnow.qc index 1bb1bd47b..dc569f69a 100644 --- a/qcsrc/common/triggers/func/rainsnow.qc +++ b/qcsrc/common/triggers/func/rainsnow.qc @@ -37,7 +37,7 @@ spawnfunc(func_rain) this.angles = '0 0 0'; this.movetype = MOVETYPE_NONE; this.solid = SOLID_NOT; - SetBrushEntityModel(); + SetBrushEntityModel(this); if (!this.cnt) this.cnt = 12; if (!this.count) @@ -75,7 +75,7 @@ spawnfunc(func_snow) this.angles = '0 0 0'; this.movetype = MOVETYPE_NONE; this.solid = SOLID_NOT; - SetBrushEntityModel(); + SetBrushEntityModel(this); if (!this.cnt) this.cnt = 12; if (!this.count) diff --git a/qcsrc/common/turrets/targettrigger.qc b/qcsrc/common/turrets/targettrigger.qc index 362cd0883..15dbaec4f 100644 --- a/qcsrc/common/turrets/targettrigger.qc +++ b/qcsrc/common/turrets/targettrigger.qc @@ -18,7 +18,7 @@ spawnfunc(turret_targettrigger) { if(!autocvar_g_turrets) { remove(this); return; } - WITHSELF(this, InitTrigger()); + InitTrigger(this); settouch(this, turret_targettrigger_touch); } diff --git a/qcsrc/lib/net.qh b/qcsrc/lib/net.qh index 75644b3ad..771782ea7 100644 --- a/qcsrc/lib/net.qh +++ b/qcsrc/lib/net.qh @@ -133,10 +133,10 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); } e.SendEntity = func_null; } - .void() uncustomizeentityforclient; + .void(entity this) uncustomizeentityforclient; .float uncustomizeentityforclient_set; - void SetCustomizer(entity e, bool(entity this) customizer, void() uncustomizer) + void SetCustomizer(entity e, bool(entity this) customizer, void(entity this) uncustomizer) { setcefc(e, customizer); e.uncustomizeentityforclient = uncustomizer; @@ -145,7 +145,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); } void UncustomizeEntitiesRun() { - FOREACH_ENTITY_FLOAT(uncustomizeentityforclient_set, true, WITHSELF(it, it.uncustomizeentityforclient())); + FOREACH_ENTITY_FLOAT(uncustomizeentityforclient_set, true, it.uncustomizeentityforclient(it)); } STRING_ITERATOR(g_buf, string_null, 0); diff --git a/qcsrc/server/g_models.qc b/qcsrc/server/g_models.qc index 363650ce8..38e72c732 100644 --- a/qcsrc/server/g_models.qc +++ b/qcsrc/server/g_models.qc @@ -167,7 +167,7 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf) #define G_MODEL_INIT(ent,sol) \ if(ent.geomtype) if(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) ent.movetype = MOVETYPE_PHYSICS; \ if(!ent.scale) ent.scale = ent.modelscale; \ - SetBrushEntityModel(); \ + SetBrushEntityModel(ent); \ ent.use = g_model_setcolormaptoactivator; \ InitializeEntity(ent, g_model_dropbyspawnflags, INITPRIO_DROPTOFLOOR); \ if(!ent.solid) ent.solid = (sol); else if(ent.solid < 0) ent.solid = SOLID_NOT; @@ -175,7 +175,7 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf) #define G_CLIENTMODEL_INIT(ent,sol) \ if(ent.geomtype) if(autocvar_physics_ode && checkextension("DP_PHYSICS_ODE")) ent.movetype = MOVETYPE_PHYSICS; \ if(!ent.scale) ent.scale = ent.modelscale; \ - SetBrushEntityModel(); \ + SetBrushEntityModel(ent); \ ent.use = g_clientmodel_use; \ InitializeEntity(ent, g_clientmodel_dropbyspawnflags, INITPRIO_DROPTOFLOOR); \ if(!ent.solid) ent.solid = (sol); else if(ent.solid < 0) ent.solid = SOLID_NOT; \ diff --git a/qcsrc/server/g_subs.qc b/qcsrc/server/g_subs.qc index 5d4f15616..2134278a2 100644 --- a/qcsrc/server/g_subs.qc +++ b/qcsrc/server/g_subs.qc @@ -260,8 +260,8 @@ float LOD_customize(entity this) return true; } -void LOD_uncustomize() -{SELFPARAM(); +void LOD_uncustomize(entity this) +{ this.modelindex = this.lodmodelindex0; } @@ -352,43 +352,43 @@ void ApplyMinMaxScaleAngles(entity e) setsize(e, e.mins, e.maxs); } -void SetBrushEntityModel() -{SELFPARAM(); - if(self.model != "") +void SetBrushEntityModel(entity this) +{ + if(this.model != "") { - precache_model(self.model); - if(self.mins != '0 0 0' || self.maxs != '0 0 0') + precache_model(this.model); + if(this.mins != '0 0 0' || this.maxs != '0 0 0') { - vector mi = self.mins; - vector ma = self.maxs; - _setmodel(self, self.model); // no precision needed - setsize(self, mi, ma); + vector mi = this.mins; + vector ma = this.maxs; + _setmodel(this, this.model); // no precision needed + setsize(this, mi, ma); } else - _setmodel(self, self.model); // no precision needed - InitializeEntity(self, LODmodel_attach, INITPRIO_FINDTARGET); + _setmodel(this, this.model); // no precision needed + InitializeEntity(this, LODmodel_attach, INITPRIO_FINDTARGET); } - setorigin(self, self.origin); - ApplyMinMaxScaleAngles(self); + setorigin(this, this.origin); + ApplyMinMaxScaleAngles(this); } -void SetBrushEntityModelNoLOD() -{SELFPARAM(); - if(self.model != "") +void SetBrushEntityModelNoLOD(entity this) +{ + if(this.model != "") { - precache_model(self.model); - if(self.mins != '0 0 0' || self.maxs != '0 0 0') + precache_model(this.model); + if(this.mins != '0 0 0' || this.maxs != '0 0 0') { - vector mi = self.mins; - vector ma = self.maxs; - _setmodel(self, self.model); // no precision needed - setsize(self, mi, ma); + vector mi = this.mins; + vector ma = this.maxs; + _setmodel(this, this.model); // no precision needed + setsize(this, mi, ma); } else - _setmodel(self, self.model); // no precision needed + _setmodel(this, this.model); // no precision needed } - setorigin(self, self.origin); - ApplyMinMaxScaleAngles(self); + setorigin(this, this.origin); + ApplyMinMaxScaleAngles(this); } /* @@ -410,28 +410,28 @@ void SetMovedir(entity this) this.angles = '0 0 0'; } -void InitTrigger() -{SELFPARAM(); +void InitTrigger(entity this) +{ // trigger angles are used for one-way touches. An angle of 0 is assumed // to mean no restrictions, so use a yaw of 360 instead. SetMovedir(self); self.solid = SOLID_TRIGGER; - SetBrushEntityModel(); + SetBrushEntityModel(this); self.movetype = MOVETYPE_NONE; self.modelindex = 0; self.model = ""; } -void InitSolidBSPTrigger() -{SELFPARAM(); +void InitSolidBSPTrigger(entity this) +{ // trigger angles are used for one-way touches. An angle of 0 is assumed // to mean no restrictions, so use a yaw of 360 instead. - SetMovedir(self); - self.solid = SOLID_BSP; - SetBrushEntityModel(); - self.movetype = MOVETYPE_NONE; // why was this PUSH? -div0 -// self.modelindex = 0; - self.model = ""; + SetMovedir(this); + this.solid = SOLID_BSP; + SetBrushEntityModel(this); + this.movetype = MOVETYPE_NONE; // why was this PUSH? -div0 +// this.modelindex = 0; + this.model = ""; } bool InitMovingBrushTrigger(entity this) @@ -439,7 +439,7 @@ bool InitMovingBrushTrigger(entity this) // trigger angles are used for one-way touches. An angle of 0 is assumed // to mean no restrictions, so use a yaw of 360 instead. this.solid = SOLID_BSP; - WITHSELF(this, SetBrushEntityModel()); + SetBrushEntityModel(this); this.movetype = MOVETYPE_PUSH; if(this.modelindex == 0) { diff --git a/qcsrc/server/g_subs.qh b/qcsrc/server/g_subs.qh index 591993346..b18cc67b5 100644 --- a/qcsrc/server/g_subs.qh +++ b/qcsrc/server/g_subs.qh @@ -140,15 +140,15 @@ float angc (float a1, float a2); float LOD_customize(entity this); -void LOD_uncustomize(); +void LOD_uncustomize(entity this); void LODmodel_attach(entity this); void ApplyMinMaxScaleAngles(entity e); -void SetBrushEntityModel(); +void SetBrushEntityModel(entity this); -void SetBrushEntityModelNoLOD(); +void SetBrushEntityModelNoLOD(entity this); /* ================ @@ -158,8 +158,8 @@ InitTrigger void SetMovedir(entity this); -void InitTrigger(); +void InitTrigger(entity this); -void InitSolidBSPTrigger(); +void InitSolidBSPTrigger(entity this); bool InitMovingBrushTrigger(entity this);