e.oldorigin_x = compressShortVector(e.velocity);
e.species = bloodtype;
- Net_LinkEntity(e, false, 0.2, Damage_DamageInfo_SendEntity);
+ Net_LinkEntity(e, false, true, 0.2, Damage_DamageInfo_SendEntity);
}
#endif
e.scale2 = -s2;
float sz = max(e.scale, e.scale2);
setsize(e, e.mins * sz, e.maxs * sz);
- Net_LinkEntity(e, false, 0.1, modeleffect_SendEntity);
+ Net_LinkEntity(e, false, true, 0.1, modeleffect_SendEntity);
}
#endif
e.owner = player;
setthink(e, entcs_think);
e.nextthink = time;
- Net_LinkEntity(e, false, 0, entcs_send);
+ Net_LinkEntity(e, false, true, 0, entcs_send);
// NOTE: the following code block has been disabled as a workaround for https://gitlab.com/xonotic/xonotic-data.pk3dir/-/issues/1824
#if 0
if (!IS_REAL_CLIENT(player)) return;
void onslaught_controlpoint_icon_link(entity e, void(entity this) spawnproc)
{
- Net_LinkEntity(e, true, 0, cpicon_send);
+ Net_LinkEntity(e, true, true, 0, cpicon_send);
setthink(e, spawnproc);
e.nextthink = time + sys_frametime;
}
cam.origin = this.origin;
setorigin(cam, cam.origin);
cam.angles = best_ang;
- Net_LinkEntity(cam, false, 0, clientcamera_send);
+ Net_LinkEntity(cam, false, true, 0, clientcamera_send);
FOREACH_CLIENT(true, it.clientcamera = cam;);
setthink(this, ons_GeneratorThink);
this.nextthink = time + GEN_THINKRATE;
- Net_LinkEntity(this, false, 0, generator_send);
+ Net_LinkEntity(this, false, true, 0, generator_send);
this.SendFlags = GSF_SETUP; // just incase
this.SendFlags |= GSF_STATUS;
onslaught_updatelinks();
- Net_LinkEntity(this, false, 0, generator_send);
+ Net_LinkEntity(this, false, true, 0, generator_send);
}
ons_worldlinklist = this;
InitializeEntity(this, ons_DelayedLinkSetup, INITPRIO_FINDTARGET);
- Net_LinkEntity(this, false, 0, ons_Link_Send);
+ Net_LinkEntity(this, false, true, 0, ons_Link_Send);
}
/*QUAKED spawnfunc_onslaught_controlpoint (0 .5 .8) (-32 -32 0) (32 32 128)
setcefc(inv, Inventory_customize);
this.inventory = inv;
inv.owner = this;
- Net_LinkEntity(inv, false, 0, Inventory_Send);
+ Net_LinkEntity(inv, false, true, 0, Inventory_Send);
}
void Inventory_delete(entity e) { delete(e.inventory); }
void Inventory_update(entity e) { e.inventory.SendFlags = 0xFFFFFF; }
this.reset = generic_netlinked_reset;
this.reset(this);
- Net_LinkEntity(this, 0, false, conveyor_send);
+ Net_LinkEntity(this, false, true, 0, conveyor_send);
this.SendFlags |= SF_TRIGGER_INIT;
}
void door_link()
{
- //Net_LinkEntity(this, false, 0, door_send);
+ //Net_LinkEntity(this, false, true, 0, door_send);
}
#endif
void plat_link(entity this)
{
- //Net_LinkEntity(this, 0, false, plat_send);
+ //Net_LinkEntity(this, false, true, 0, plat_send);
}
spawnfunc(func_plat)
//if(!this.cnt) this.cnt = _particleeffectnum(this.mdl);
this.setactive = generic_netlinked_setactive;
- Net_LinkEntity(this, (this.spawnflags & PARTICLES_VISCULLING), 0, pointparticles_SendEntity);
+ Net_LinkEntity(this, (this.spawnflags & PARTICLES_VISCULLING), true, 0, pointparticles_SendEntity);
if(this.targetname && this.targetname != "")
{
this.state = RAINSNOW_RAIN;
- Net_LinkEntity(this, false, 0, rainsnow_SendEntity);
+ Net_LinkEntity(this, false, true, 0, rainsnow_SendEntity);
}
this.state = RAINSNOW_SNOW;
- Net_LinkEntity(this, false, 0, rainsnow_SendEntity);
+ Net_LinkEntity(this, false, true, 0, rainsnow_SendEntity);
}
#elif defined(CSQC)
float autocvar_cl_rainsnow_maxdrawdist = 1000;
void train_link(entity this)
{
- //Net_LinkEntity(this, 0, false, train_send);
+ //Net_LinkEntity(this, false, true, 0, train_send);
}
void train_use(entity this, entity actor, entity trigger)
this.mangle = this.angles;
- Net_LinkEntity(this, false, 0, laser_SendEntity);
+ Net_LinkEntity(this, false, true, 0, laser_SendEntity);
this.setactive = laser_setactive;
void teleport_dest_link(entity this)
{
- Net_LinkEntity(this, false, 0, teleport_dest_send);
+ Net_LinkEntity(this, false, true, 0, teleport_dest_send);
this.SendFlags |= SF_TRIGGER_INIT;
}
else if(ent.solid < 0) ent.solid = SOLID_NOT; \
if(!ent.bgmscriptsustain) ent.bgmscriptsustain = 1; \
else if(ent.bgmscriptsustain < 0) ent.bgmscriptsustain = 0; \
- Net_LinkEntity(ent, true, 0, g_clientmodel_genericsendentity); \
+ Net_LinkEntity(ent, true, true, 0, g_clientmodel_genericsendentity); \
ent.default_solid = sol;
// non-solid model entities:
this.reset = trigger_music_reset;
this.reset(this);
- Net_LinkEntity(this, false, 0, trigger_music_SendEntity);
+ Net_LinkEntity(this, false, true, 0, trigger_music_SendEntity);
}
#elif defined(CSQC)
void target_push_link(entity this)
{
BITSET_ASSIGN(this.effects, EF_NODEPTHTEST);
- Net_LinkEntity(this, false, 0, target_push_send);
+ Net_LinkEntity(this, false, true, 0, target_push_send);
//this.SendFlags |= 1; // update
}
void trigger_keylock_link(entity this)
{
// uncomment to network keylocks
- //Net_LinkEntity(this, false, 0, trigger_keylock_send);
+ //Net_LinkEntity(this, false, true, 0, trigger_keylock_send);
}
/*QUAKED trigger_keylock (.0 .5 .8) ?
if(!this.goalentity)
this.goalentity = this.enemy; // make them match so CSQC knows what to do
- Net_LinkEntity(this, false, 0, trigger_viewloc_send);
+ Net_LinkEntity(this, false, true, 0, trigger_viewloc_send);
setthink(this, viewloc_think);
this.nextthink = time;
{
if(this.angle)
this.angles_y = this.angle;
- Net_LinkEntity(this, false, 0, viewloc_send);
+ Net_LinkEntity(this, false, true, 0, viewloc_send);
}
spawnfunc(target_viewlocation_start)
void trigger_link(entity this, bool(entity this, entity to, int sendflags) sendfunc)
{
- setSendEntity(this, sendfunc);
- this.SendFlags = 0xFFFFFF;
+ Net_LinkEntity(this, true, false, 0, sendfunc);
}
void trigger_common_write(entity this, bool withtarget)
controller.owner = minigame;
controller.bd_tilelet = letter;
#ifdef SVQC
- Net_LinkEntity(controller, false, 0, bd_controller_send);
+ Net_LinkEntity(controller, false, true, 0, bd_controller_send);
#endif
}
e.minigame_autoclean = 1;
#ifdef SVQC
setcefc(e, minigame_CheckSend);
- Net_LinkEntity(e, false, 0, minigame_SendEntity);
+ Net_LinkEntity(e, false, true, 0, minigame_SendEntity);
#endif
return e;
}
CS(player).active_minigame = minigame_session;
player.minigame_players = player_pointer;
setcefc(player_pointer, minigame_CheckSend);
- Net_LinkEntity(player_pointer, false, 0, minigame_SendEntity);
+ Net_LinkEntity(player_pointer, false, true, 0, minigame_SendEntity);
if ( !IS_OBSERVER(player) && autocvar_sv_minigames_observer )
PutObserverInServer(player, true, true);
end_minigame(minig);
return NULL;
}
- Net_LinkEntity(minig, false, 0, minigame_SendEntity);
+ Net_LinkEntity(minig, false, true, 0, minigame_SendEntity);
if ( !minigame_sessions )
minigame_sessions = minig;
// good
if (mutator_log) LOG_TRACEF("Mutator: added %s", mut.m_name);
#ifdef SVQC
- Net_LinkEntity(mut, false, 0, Mutator_SendEntity);
+ Net_LinkEntity(mut, false, true, 0, Mutator_SendEntity);
#endif
return true;
}
setthink(net_text, SUB_Remove);
net_text.nextthink = (time > 10) ? (time + 0.5) : 10; // allow a buffer from start time for clients to load in
- Net_LinkEntity(net_text, false, 0, write_damagetext);
+ Net_LinkEntity(net_text, false, true, 0, write_damagetext);
}
vector size = '1 1 1' * orb.orb_radius / 2;
setsize(orb, -size, size);
- Net_LinkEntity(orb, true, 0, orb_send);
+ Net_LinkEntity(orb, true, true, 0, orb_send);
orb.SendFlags |= 1;
setthink(orb, nades_orb_think);
item.effects |= EF_NODRAW; // hide the original weapon
set_movetype(item, MOVETYPE_FOLLOW);
item.aiment = wep; // attach the original weapon
- setSendEntity(item, func_null);
+ Net_UnlinkEntity(item);
}
if(this.statuseffects_store)
{
setcefc(eff, StatusEffects_customize);
- Net_LinkEntity(eff, false, 0, StatusEffects_Send);
+ Net_LinkEntity(eff, false, true, 0, StatusEffects_Send);
}
}
void StatusEffects_delete(entity e) { delete(e.statuseffects); e.statuseffects = NULL; }
wp.reset2 = WaypointSprite_Reset;
wp.cnt = icon.m_id;
wp.colormod = spr.m_color;
- Net_LinkEntity(wp, false, 0, WaypointSprite_SendEntity);
+ Net_LinkEntity(wp, false, true, 0, WaypointSprite_SendEntity);
return wp;
}
net_notif.nent_client = client;
net_notif.nent_net_type = MSG_CENTER_KILL;
net_notif.nent_net_name = ORDINAL(net_cpid);
- Net_LinkEntity(net_notif, false, autocvar_notification_lifetime_runtime, Net_Write_Notification);
+ Net_LinkEntity(net_notif, false, true, autocvar_notification_lifetime_runtime, Net_Write_Notification);
IL_EACH(g_notifications,
(it.owner.nent_type == net_type || net_type == MSG_Null) && (it.owner.nent_cpid == net_cpid || net_cpid == CPID_Null),
? (time + autocvar_notification_lifetime_runtime)
: autocvar_notification_lifetime_mapload;
- Net_LinkEntity(net_notif, false, 0, Net_Write_Notification);
+ Net_LinkEntity(net_notif, false, true, 0, Net_Write_Notification);
}
}
void turret_link(entity this)
{
- Net_LinkEntity(this, true, 0, turret_send);
+ Net_LinkEntity(this, true, true, 0, turret_send);
setthink(this, turret_think);
this.nextthink = time;
this.tur_head.effects = EF_NODRAW;
//axh.drawonlytoclient = own; // not spectatable
setcefc(axh, AuxiliaryXhair_customize);
axh.owner = own;
- Net_LinkEntity(axh, false, 0, SendAuxiliaryXhair);
+ Net_LinkEntity(axh, false, true, 0, SendAuxiliaryXhair);
}
if(loc != axh.axh_prevorigin)
if(instance.gun3.enemy == NULL)
{
instance.gun3.enemy = new(bumble_raygun);
- Net_LinkEntity(instance.gun3.enemy, true, 0, bumble_raygun_send);
+ Net_LinkEntity(instance.gun3.enemy, true, true, 0, bumble_raygun_send);
instance.gun3.enemy.SendFlags = BRG_SETUP;
instance.gun3.enemy.cnt = autocvar_g_vehicle_bumblebee_raygun;
instance.gun3.enemy.effects = EF_NODRAW | EF_LOWPRECISION;
METHOD(Racer, vr_death, void(Racer thisveh, entity instance))
{
#ifdef SVQC
- setSendEntity(instance, func_null); // stop networking this racer (for now)
+ Net_UnlinkEntity(instance); // stop networking this racer (for now)
SetResourceExplicit(instance, RES_HEALTH, 0);
instance.event_damage = func_null;
instance.solid = SOLID_CORPSE;
IL_PUSH(g_bot_dodge, beam);
beam.bot_dodgerating = WEP_CVAR(arc, beam_damage);
beam.beam_bursting = burst;
- Net_LinkEntity(beam, false, 0, W_Arc_Beam_Send);
+ Net_LinkEntity(beam, false, true, 0, W_Arc_Beam_Send);
getthink(beam)(beam);
}
setthink(note, W_Tuba_NoteThink);
note.nextthink = time;
note.spawnshieldtime = time;
- Net_LinkEntity(note, false, 0, W_Tuba_NoteSendEntity);
+ Net_LinkEntity(note, false, true, 0, W_Tuba_NoteSendEntity);
}
actor.(weaponentity).tuba_note.teleport_time = time + WEP_CVAR(tuba, refire) * 2 * W_WeaponRateFactor(actor); // so it can get prolonged safely
e.nextthink = time;
//e.drawonlytoclient = wep.owner;
setcefc(e, wepent_customize);
- Net_LinkEntity(e, false, 0, wepent_send);
+ Net_LinkEntity(e, false, true, 0, wepent_send);
}
#endif
void CSQCModel_LinkEntity(entity e)
{
- setSendEntity(e, CSQCModel_Send);
- e.SendFlags = 0xFFFFFF;
+ Net_LinkEntity(e, true, false, 0, CSQCModel_Send);
CSQCModel_CheckUpdate(e);
}
void CSQCModel_UnlinkEntity(entity e)
{
- setSendEntity(e, func_null);
+ Net_UnlinkEntity(e);
}
IntrusiveList g_uncustomizables;
STATIC_INIT(g_uncustomizables) { g_uncustomizables = IL_NEW(); }
- void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
+ void Net_LinkEntity(entity e, bool docull, bool checkmodel, float dt, bool(entity this, entity to, int sendflags) sendfunc)
{
if (e.classname == "")
{
e.classname = "net_linked";
}
- if (e.model == "" || e.modelindex == 0)
+ if (checkmodel && (e.model == "" || e.modelindex == 0))
{
vector mi = e.mins;
vector ma = e.maxs;
entity ts = new(warpzone_teleported);
setmodel(ts, MDL_Null);
- setSendEntity(ts, WarpZone_Teleported_Send);
- ts.SendFlags = 0xFFFFFF;
+ Net_LinkEntity(ts, false, false, 1, WarpZone_Teleported_Send);
ts.drawonlytoclient = player;
- setthink(ts, SUB_Remove);
- ts.nextthink = time + 1;
ts.owner = player;
ts.enemy = wz;
- ts.effects = EF_NODEPTHTEST;
ts.angles = wz.warpzone_transform;
}
#elif defined(CSQC)
setsize(this, this.mins * this.scale, this.maxs * this.scale);
else
setsize(this, this.mins, this.maxs);
- setSendEntity(this, WarpZone_Send);
- this.SendFlags = 0xFFFFFF;
- BITSET_ASSIGN(this.effects, EF_NODEPTHTEST);
+ Net_LinkEntity(this, false, false, 0, WarpZone_Send);
this.warpzone_next = warpzone_first;
warpzone_first = this;
this.solid = SOLID_BSP;
else if(this.solid < 0)
this.solid = SOLID_NOT;
- setSendEntity(this, WarpZone_Camera_Send);
- this.SendFlags = 0xFFFFFF;
+ Net_LinkEntity(this, true, false, 0, WarpZone_Camera_Send);
this.warpzone_next = warpzone_camera_first;
warpzone_camera_first = this;
}
void ClientData_Attach(entity this)
{
- Net_LinkEntity(CS(this).clientdata = new_pure(clientdata), false, 0, ClientData_Send);
+ Net_LinkEntity(CS(this).clientdata = new_pure(clientdata), false, true, 0, ClientData_Send);
CS(this).clientdata.drawonlytoclient = this;
CS(this).clientdata.owner = this;
}
entity spawnevent = new_pure(spawnevent);
spawnevent.owner = this;
- Net_LinkEntity(spawnevent, false, 0.5, SpawnEvent_Send);
+ Net_LinkEntity(spawnevent, false, true, 0.5, SpawnEvent_Send);
// Cut off any still running player sounds.
stopsound(this, CH_PLAYER_SINGLE);
{
entity e = new_pure(clientinit);
setthink(e, ClientInit_CheckUpdate);
- Net_LinkEntity(e, false, 0, ClientInit_SendEntity);
+ Net_LinkEntity(e, false, true, 0, ClientInit_SendEntity);
ClientInit_CheckUpdate(e);
}
void Nagger_Init()
{
- Net_LinkEntity(nagger = new_pure(nagger), false, 0, Nagger_SendEntity);
+ Net_LinkEntity(nagger = new_pure(nagger), false, true, 0, Nagger_SendEntity);
}
void Nagger_VoteChanged()
backtrace("Can't spawn eliminatedPlayers again!");
return;
}
- Net_LinkEntity(eliminatedPlayers = new_pure(eliminatedPlayers), false, 0, EliminatedPlayers_SendEntity);
+ Net_LinkEntity(eliminatedPlayers = new_pure(eliminatedPlayers), false, true, 0, EliminatedPlayers_SendEntity);
eliminatedPlayers.isEliminated = isEliminated_func;
}
missile.hook_start = missile.hook_end = missile.origin;
- Net_LinkEntity(missile, false, 0, GrapplingHookSend);
+ Net_LinkEntity(missile, false, true, 0, GrapplingHookSend);
}
// NOTE: using PRECACHE here to make sure it's called after everything else
else
Item_Reset(this);
- Net_LinkEntity(this, !(def.instanceOfPowerup || def.instanceOfHealth || def.instanceOfArmor), 0, ItemSend);
+ Net_LinkEntity(this, !(def.instanceOfPowerup || def.instanceOfHealth || def.instanceOfArmor), true, 0, ItemSend);
// call this hook after everything else has been done
if (MUTATOR_CALLHOOK(Item_Spawn, this))
void MapVote_Spawn()
{
- Net_LinkEntity(mapvote_ent = new(mapvote_ent), false, 0, MapVote_SendEntity);
+ Net_LinkEntity(mapvote_ent = new(mapvote_ent), false, true, 0, MapVote_SendEntity);
}
void MapVote_TouchMask()
entity ts = new_pure(csqc_score_team);
ts.netname = name; // not used yet, FIXME
ts.team = t;
- Net_LinkEntity(ts, false, 0, TeamScore_SendEntity);
+ Net_LinkEntity(ts, false, true, 0, TeamScore_SendEntity);
teamscorekeepers[t - 1] = ts;
++teamscores_entities_count;
PlayerStats_GameReport_AddTeam(t);
else
{
scores_initialized = new_pure(ent_client_scoreinfo);
- Net_LinkEntity(scores_initialized, false, 0, ScoreInfo_SendEntity);
+ Net_LinkEntity(scores_initialized, false, true, 0, ScoreInfo_SendEntity);
}
if(teams & BIT(0))
TeamScore_Spawn(NUM_TEAM_1, "Red");
error("player already has a scorekeeper");
entity sk = new_pure(scorekeeper);
sk.owner = player;
- Net_LinkEntity(sk, false, 0, PlayerScore_SendEntity);
+ Net_LinkEntity(sk, false, true, 0, PlayerScore_SendEntity);
CS(player).scorekeeper = sk;
}
// and don't show non-team spawns in team matches.
// (Unless useallspawns is activated)
if(anypoint || !((teamplay && !Team_IsValidTeam(this.team)) || (!teamplay && Team_IsValidTeam(this.team))))
- Net_LinkEntity(this, false, 0, SpawnPoint_Send);
+ Net_LinkEntity(this, false, true, 0, SpawnPoint_Send);
}
void relocate_spawnpoint(entity this)
entity a = CS(e).accuracy = new_pure(accuracy);
a.owner = e;
a.drawonlytoclient = e;
- Net_LinkEntity(a, false, 0, accuracy_send);
+ Net_LinkEntity(a, false, true, 0, accuracy_send);
}
void accuracy_free(entity e)
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
{
- Net_LinkEntity(e, docull, 0, CSQCProjectile_SendEntity);
+ Net_LinkEntity(e, docull, true, 0, CSQCProjectile_SendEntity);
e.csqcprojectile_clientanimate = clientanimate;
{
randomseed = new_pure(randomseed);
setthink(randomseed, RandomSeed_Think);
- Net_LinkEntity(randomseed, false, 0, RandomSeed_Send);
+ Net_LinkEntity(randomseed, false, true, 0, RandomSeed_Send);
getthink(randomseed)(randomseed); // sets random seed and nextthink
}