SpawnBall(this);
}
-float nb_Goal_Customize()
-{SELFPARAM();
+float nb_Goal_Customize(entity this)
+{
entity e, wp_owner;
e = WaypointSprite_getviewentity(other);
wp_owner = self.owner;
{
entity wp = WaypointSprite_SpawnFixed(WP_NbGoal, (this.absmin + this.absmax) * 0.5, this, sprite, RADARICON_NONE);
wp.colormod = ((this.team) ? Team_ColorRGB(this.team) : '1 0.5 0');
- this.sprite.customizeentityforclient = nb_Goal_Customize;
+ setcefc(this.sprite, nb_Goal_Customize);
}
this.classname = "nexball_goal";
CSQCProjectile(missile, true, PROJECTILE_ELECTRO, true);
}
-float ball_customize()
-{SELFPARAM();
+float ball_customize(entity this)
+{
if(!self.owner)
{
self.effects &= ~EF_FLAME;
self.scale = 1;
- self.customizeentityforclient = func_null;
+ setcefc(self, func_null);
return true;
}
{
// 'view ball'
self.ballcarried.velocity = self.velocity;
- self.ballcarried.customizeentityforclient = ball_customize;
+ setcefc(self.ballcarried, ball_customize);
vector org = self.origin + self.view_ofs +
v_forward * autocvar_g_nexball_viewmodel_offset.x +
// CaptureShield Functions
// =======================
-bool ons_CaptureShield_Customize()
-{SELFPARAM();
+bool ons_CaptureShield_Customize(entity this)
+{
entity e = WaypointSprite_getviewentity(other);
if(!self.enemy.isshielded && (ons_ControlPoint_Attackable(self.enemy, e.team) > 0 || self.enemy.classname != "onslaught_controlpoint")) { return false; }
shield.colormap = generator.colormap;
shield.reset = ons_CaptureShield_Reset;
settouch(shield, ons_CaptureShield_Touch);
- shield.customizeentityforclient = ons_CaptureShield_Customize;
+ setcefc(shield, ons_CaptureShield_Customize);
shield.effects = EF_ADDITIVE;
shield.movetype = MOVETYPE_NOCLIP;
shield.solid = SOLID_TRIGGER;
e.owner = minigame_session;
e.minigame_autoclean = 1;
#ifdef SVQC
- e.customizeentityforclient = minigame_CheckSend;
+ setcefc(e, minigame_CheckSend);
Net_LinkEntity(e, false, 0, minigame_SendEntity);
#endif
return e;
}
}
-bool minigame_CheckSend()
-{SELFPARAM();
+bool minigame_CheckSend(entity this)
+{
entity e;
for ( e = self.owner.minigame_players; e != world; e = e.list_next )
if ( e.minigame_players == other )
minigame_session.minigame_players = player_pointer;
player.active_minigame = minigame_session;
player.minigame_players = player_pointer;
- player_pointer.customizeentityforclient = minigame_CheckSend;
+ setcefc(player_pointer, minigame_CheckSend);
Net_LinkEntity(player_pointer, false, 0, minigame_SendEntity);
if ( !IS_OBSERVER(player) && autocvar_sv_minigames_observer )
// Only sends entities to players who joined the minigame
// Use on customizeentityforclient for gameplay entities
-bool minigame_CheckSend();
+bool minigame_CheckSend(entity this);
// Check for minigame impulses
bool MinigameImpulse(entity this, int imp);
}
}
-bool buffs_BuffModel_Customize()
-{SELFPARAM();
+bool buffs_BuffModel_Customize(entity this)
+{
entity player, myowner;
bool same_team;
player.buff_model.scale = 0.7;
player.buff_model.pflags = PFLAGS_FULLDYNAMIC;
player.buff_model.light_lev = 200;
- player.buff_model.customizeentityforclient = buffs_BuffModel_Customize;
+ setcefc(player.buff_model, buffs_BuffModel_Customize);
}
vector buff_GlowColor(entity buff)
buff_Respawn(this);
}
-float buff_Customize()
-{SELFPARAM();
+float buff_Customize(entity this)
+{
entity player = WaypointSprite_getviewentity(other);
if(!this.buff_active || (this.team && DIFF_TEAM(player, this)))
{
this.skin = buff.m_skin;
this.effects = EF_FULLBRIGHT | EF_STARDUST | EF_NOSHADOW;
this.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY;
- this.customizeentityforclient = buff_Customize;
+ setcefc(this, buff_Customize);
//this.gravity = 100;
this.color = buff.m_color;
this.glowmod = buff_GlowColor(this);
_nade.max_health = _nade.health;
_nade.takedamage = DAMAGE_AIM;
_nade.event_damage = nade_damage;
- _nade.customizeentityforclient = func_null;
+ setcefc(_nade, func_null);
_nade.exteriormodeltoclient = world;
_nade.traileffectnum = 0;
_nade.teleportable = true;
nades_RemoveBonus(self);
}
-float nade_customize()
-{SELFPARAM();
+float nade_customize(entity this)
+{
//if(IS_SPEC(other)) { return false; }
if(other == self.exteriormodeltoclient || (IS_SPEC(other) && other.enemy == self.exteriormodeltoclient))
{
setmodel(n, MDL_PROJECTILE_NADE);
//setattachment(n, player, "bip01 l hand");
n.exteriormodeltoclient = player;
- n.customizeentityforclient = nade_customize;
+ setcefc(n, nade_customize);
n.traileffectnum = _particleeffectnum(Nade_TrailEffect(Nades_from(n.nade_type).m_projectile[false], player.team).eent_eff_name);
n.colormod = Nades_from(n.nade_type).m_color;
n.realowner = nowner;
return e2 == e;
}
-float WaypointSprite_Customize()
-{SELFPARAM();
+float WaypointSprite_Customize(entity this)
+{
// this is not in SendEntity because it shall run every frame, not just every update
// make spectators see what the player would see
setthink(wp, WaypointSprite_Think);
wp.nextthink = time;
wp.model1 = spr.netname;
- wp.customizeentityforclient = WaypointSprite_Customize;
+ setcefc(wp, WaypointSprite_Customize);
wp.waypointsprite_visible_for_player = WaypointSprite_visible_for_player;
wp.reset2 = WaypointSprite_Reset;
wp.cnt = icon.m_id;
float WaypointSprite_isteammate(entity e, entity e2);
-float WaypointSprite_Customize();
+float WaypointSprite_Customize(entity this);
bool WaypointSprite_SendEntity(entity this, entity to, float sendflags);
.void() uncustomizeentityforclient;
.float uncustomizeentityforclient_set;
- void SetCustomizer(entity e, float() customizer, void() uncustomizer)
+ void SetCustomizer(entity e, bool(entity this) customizer, void() uncustomizer)
{
- e.customizeentityforclient = customizer;
+ setcefc(e, customizer);
e.uncustomizeentityforclient = uncustomizer;
e.uncustomizeentityforclient_set = !!uncustomizer;
}
SELFWRAP(predraw, void, (entity this), (this))
#define setpredraw(e, f) SELFWRAP_SET(predraw, e, f)
+SELFWRAP(customizeentityforclient, bool, (entity this), (this))
+#define setcefc(e, f) SELFWRAP_SET(customizeentityforclient, e, f)
+#define getcefc(e) SELFWRAP_GET(customizeentityforclient, e)
+
#ifndef MENUQC
void adaptor_think2touch(entity this) { WITH(entity, other, NULL, gettouch(this)(this)); }
void adaptor_think2use(entity this) { if (this.use) this.use(this, NULL, NULL); }
clone.solid = this.solid;
clone.ballistics_density = this.ballistics_density;
clone.takedamage = this.takedamage;
- clone.customizeentityforclient = this.customizeentityforclient;
+ setcefc(clone, getcefc(this));
clone.uncustomizeentityforclient = this.uncustomizeentityforclient;
clone.uncustomizeentityforclient_set = this.uncustomizeentityforclient_set;
if (keepvelocity == 1)
float default_player_alpha;
float default_weapon_alpha;
-.float() customizeentityforclient;
.float cvar_cl_handicap;
.float cvar_cl_clippedspectating;
.float cvar_cl_autoscreenshot;
return org;
}
-float LOD_customize()
-{SELFPARAM();
+float LOD_customize(entity this)
+{
if(autocvar_loddebug)
{
int d = autocvar_loddebug;
.float loddistance1;
.float loddistance2;
-float LOD_customize();
+float LOD_customize(entity this);
void LOD_uncustomize();
float sound_allowed(float dest, entity e);
void InitializeEntity(entity e, void(entity this) func, float order);
-void SetCustomizer(entity e, float() customizer, void() uncustomizer);
}
}
-bool ctf_CaptureShield_Customize()
-{SELFPARAM();
+bool ctf_CaptureShield_Customize(entity this)
+{
if(!other.ctf_captureshielded) { return false; }
if(CTF_SAMETEAM(self, other)) { return false; }
shield.enemy = self;
shield.team = self.team;
settouch(shield, ctf_CaptureShield_Touch);
- shield.customizeentityforclient = ctf_CaptureShield_Customize;
+ setcefc(shield, ctf_CaptureShield_Customize);
shield.effects = EF_ADDITIVE;
shield.movetype = MOVETYPE_NOCLIP;
shield.solid = SOLID_TRIGGER;
}
}
-bool ctf_Stalemate_Customize()
-{SELFPARAM();
+bool ctf_Stalemate_Customize(entity this)
+{
// make spectators see what the player would see
entity e, wp_owner;
e = WaypointSprite_getviewentity(other);
{
entity wp = WaypointSprite_Spawn(((ctf_oneflag) ? WP_FlagCarrier : WP_FlagCarrierEnemy), 0, 0, tmp_entity.owner, FLAG_WAYPOINT_OFFSET, world, 0, tmp_entity.owner, wps_enemyflagcarrier, true, RADARICON_FLAG);
wp.colormod = WPCOLOR_ENEMYFC(tmp_entity.owner.team);
- tmp_entity.owner.wps_enemyflagcarrier.customizeentityforclient = ctf_Stalemate_Customize;
+ setcefc(tmp_entity.owner.wps_enemyflagcarrier, ctf_Stalemate_Customize);
}
}
Portal_Remove(this, 0);
}
-float Portal_Customize()
-{SELFPARAM();
+float Portal_Customize(entity this)
+{
if(IS_SPEC(other))
other = other.enemy;
if(other == this.aiment)
portal.health = autocvar_g_balance_portal_health;
setmodel(portal, MDL_PORTAL);
portal.savemodelindex = portal.modelindex;
- portal.customizeentityforclient = Portal_Customize;
+ setcefc(portal, Portal_Customize);
if(!Portal_FindSafeOrigin(portal))
{
}
-bool CL_Weaponentity_CustomizeEntityForClient()
+bool CL_Weaponentity_CustomizeEntityForClient(entity this)
{
- SELFPARAM();
this.viewmodelforclient = this.owner;
if (IS_SPEC(other) && other.enemy == this.owner) this.viewmodelforclient = other;
return true;
setthink(view, CL_Weaponentity_Think);
view.nextthink = time;
view.viewmodelforclient = actor;
- view.customizeentityforclient = CL_Weaponentity_CustomizeEntityForClient;
+ setcefc(view, CL_Weaponentity_CustomizeEntityForClient);
if (weaponentity == weaponentities[0])
{