item.effects |= EF_NODRAW; // hide the original weapon
item.movetype = MOVETYPE_FOLLOW;
item.aiment = wep; // attach the original weapon
- item.SendEntity3 = func_null;
+ setSendEntity(item, func_null);
}
#endif
void UpdateItemAfterTeleport(entity this)
{
- if(this.SendEntity3 == ItemSend)
+ if(getSendEntity(this) == ItemSend)
ItemUpdate(this);
}
METHOD(Racer, vr_death, void(Racer thisveh, entity instance))
{
#ifdef SVQC
- instance.SendEntity = func_null; // stop networking this racer (for now)
+ setSendEntity(instance, func_null); // stop networking this racer (for now)
instance.health = 0;
instance.event_damage = func_null;
instance.solid = SOLID_CORPSE;
void W_Devastator_Attack(Weapon thiswep, entity actor)
{
- entity missile;
- entity flash;
-
W_DecreaseAmmo(thiswep, actor, WEP_CVAR(devastator, ammo));
W_SetupShot_ProjectileSize(actor, '-3 -3 -3', '3 3 3', false, 5, SND_ROCKET_FIRE, CH_WEAPON_A, WEP_CVAR(devastator, damage));
Send_Effect(EFFECT_ROCKET_MUZZLEFLASH, w_shotorg, w_shotdir * 1000, 1);
- missile = WarpZone_RefSys_SpawnSameRefSys(actor);
+ entity missile = WarpZone_RefSys_SpawnSameRefSys(actor);
missile.owner = missile.realowner = actor;
actor.lastrocket = missile;
if(WEP_CVAR(devastator, detonatedelay) >= 0)
CSQCProjectile(missile, WEP_CVAR(devastator, guiderate) == 0 && WEP_CVAR(devastator, speedaccel) == 0, PROJECTILE_ROCKET, false); // because of fly sound
// muzzle flash for 1st person view
- flash = spawn();
+ entity flash = spawn();
setmodel(flash, MDL_DEVASTATOR_MUZZLEFLASH); // precision set below
SUB_SetFade(flash, time, 0.1);
flash.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
void CSQCModel_UnlinkEntity(entity e)
{
- e.SendEntity = func_null;
- e.SendEntity3 = func_null;
+ setSendEntity(e, func_null);
}
.int Version; // deprecated, use SendFlags
.int SendFlags;
- .bool(entity to, int sendflags) SendEntity;
- /** return false to remove from the client */
- .bool(entity this, entity to, int sendflags) SendEntity3;
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
{
void Net_UnlinkEntity(entity e)
{
- e.SendEntity = func_null;
+ setSendEntity(e, func_null);
}
.void(entity this) uncustomizeentityforclient;
SELFWRAP(camera_transform, vector, (vector org, vector ang), (entity this, vector org, vector ang), (this, org, ang))
#define setcamera_transform(e, f) SELFWRAP_SET(camera_transform, e, f)
+/** return false to remove from the client */
SELFWRAP(SendEntity, bool, (entity to, int sendflags), (entity this, entity to, int sendflags), (this, to, sendflags))
#define setSendEntity(e, f) SELFWRAP_SET(SendEntity, e, f)
+#define getSendEntity(e) SELFWRAP_GET(SendEntity, e)
#define ChangeYaw(e, ...) (__self = (e), builtin_ChangeYaw(__VA_ARGS__))
#define checkclient(e, ...) (__self = (e), builtin_checkclient(__VA_ARGS__))
}
if(this.lodmodelindex1)
- if (!this.SendEntity)
+ if (!getSendEntity(this))
SetCustomizer(this, LOD_customize, LOD_uncustomize);
}
void UpdateCSQCProjectile(entity e)
{
- if(e.SendEntity3 == CSQCProjectile_SendEntity)
+ if(getSendEntity(e) == CSQCProjectile_SendEntity)
{
// send new origin data
e.SendFlags |= 0x01;
}
// FIXME HACK
- else if(e.SendEntity3 == ItemSend)
+ else if(getSendEntity(e) == ItemSend)
{
ItemUpdate(e);
}
void UpdateCSQCProjectileAfterTeleport(entity e)
{
- if(e.SendEntity3 == CSQCProjectile_SendEntity)
+ if(getSendEntity(e) == CSQCProjectile_SendEntity)
{
// send new origin data
e.SendFlags |= 0x01;