From: Mario Date: Fri, 1 Jul 2022 15:27:02 +0000 (+1000) Subject: Replace all direct references to setSendEntity with Net_LinkEntity X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d934fea977f29dc41e1d7d6b7e9ad05a5da62835;p=xonotic%2Fxonotic-data.pk3dir.git Replace all direct references to setSendEntity with Net_LinkEntity --- diff --git a/qcsrc/common/effects/qc/damageeffects.qc b/qcsrc/common/effects/qc/damageeffects.qc index 3ef63b138..afde0a2bb 100644 --- a/qcsrc/common/effects/qc/damageeffects.qc +++ b/qcsrc/common/effects/qc/damageeffects.qc @@ -41,7 +41,7 @@ void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad 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 diff --git a/qcsrc/common/effects/qc/modeleffects.qc b/qcsrc/common/effects/qc/modeleffects.qc index 41eee445c..87070871e 100644 --- a/qcsrc/common/effects/qc/modeleffects.qc +++ b/qcsrc/common/effects/qc/modeleffects.qc @@ -68,7 +68,7 @@ void modeleffect_spawn(string m, float s, float f, vector o, vector v, vector an 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 diff --git a/qcsrc/common/ent_cs.qc b/qcsrc/common/ent_cs.qc index 536637145..3efb875eb 100644 --- a/qcsrc/common/ent_cs.qc +++ b/qcsrc/common/ent_cs.qc @@ -245,7 +245,7 @@ ENTCS_PROP(SOLID, true, sv_solid, solid, ENTCS_SET_NORMAL, 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; diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc b/qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc index fde9ed6fd..19c2755b7 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_controlpoint.qc @@ -34,7 +34,7 @@ bool cpicon_send(entity this, entity to, int sf) 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; } diff --git a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc index 7f2def318..f6ac557cb 100644 --- a/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc +++ b/qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc @@ -878,7 +878,7 @@ void ons_camSetup(entity this) 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;); @@ -1029,7 +1029,7 @@ void ons_GeneratorReset(entity this) 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; @@ -1053,7 +1053,7 @@ void ons_DelayedGeneratorSetup(entity this) onslaught_updatelinks(); - Net_LinkEntity(this, false, 0, generator_send); + Net_LinkEntity(this, false, true, 0, generator_send); } @@ -2089,7 +2089,7 @@ spawnfunc(onslaught_link) 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) diff --git a/qcsrc/common/items/inventory.qh b/qcsrc/common/items/inventory.qh index 22a4d94c3..73aa6d58e 100644 --- a/qcsrc/common/items/inventory.qh +++ b/qcsrc/common/items/inventory.qh @@ -140,7 +140,7 @@ void Inventory_new(PlayerState this) 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; } diff --git a/qcsrc/common/mapobjects/func/conveyor.qc b/qcsrc/common/mapobjects/func/conveyor.qc index 3666dd337..529057741 100644 --- a/qcsrc/common/mapobjects/func/conveyor.qc +++ b/qcsrc/common/mapobjects/func/conveyor.qc @@ -106,7 +106,7 @@ void conveyor_init(entity this) 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; } diff --git a/qcsrc/common/mapobjects/func/door.qc b/qcsrc/common/mapobjects/func/door.qc index 6b69077a0..f75f1e108 100644 --- a/qcsrc/common/mapobjects/func/door.qc +++ b/qcsrc/common/mapobjects/func/door.qc @@ -595,7 +595,7 @@ float door_send(entity this, entity to, float sf) void door_link() { - //Net_LinkEntity(this, false, 0, door_send); + //Net_LinkEntity(this, false, true, 0, door_send); } #endif diff --git a/qcsrc/common/mapobjects/func/plat.qc b/qcsrc/common/mapobjects/func/plat.qc index d001fe299..eef78dbbd 100644 --- a/qcsrc/common/mapobjects/func/plat.qc +++ b/qcsrc/common/mapobjects/func/plat.qc @@ -51,7 +51,7 @@ float plat_send(entity this, entity to, float sf) void plat_link(entity this) { - //Net_LinkEntity(this, 0, false, plat_send); + //Net_LinkEntity(this, false, true, 0, plat_send); } spawnfunc(func_plat) diff --git a/qcsrc/common/mapobjects/func/pointparticles.qc b/qcsrc/common/mapobjects/func/pointparticles.qc index 72ad35598..7aa34ce47 100644 --- a/qcsrc/common/mapobjects/func/pointparticles.qc +++ b/qcsrc/common/mapobjects/func/pointparticles.qc @@ -113,7 +113,7 @@ spawnfunc(func_pointparticles) //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 != "") { diff --git a/qcsrc/common/mapobjects/func/rainsnow.qc b/qcsrc/common/mapobjects/func/rainsnow.qc index de49f1e36..c779c60c5 100644 --- a/qcsrc/common/mapobjects/func/rainsnow.qc +++ b/qcsrc/common/mapobjects/func/rainsnow.qc @@ -53,7 +53,7 @@ spawnfunc(func_rain) this.state = RAINSNOW_RAIN; - Net_LinkEntity(this, false, 0, rainsnow_SendEntity); + Net_LinkEntity(this, false, true, 0, rainsnow_SendEntity); } @@ -93,7 +93,7 @@ spawnfunc(func_snow) 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; diff --git a/qcsrc/common/mapobjects/func/train.qc b/qcsrc/common/mapobjects/func/train.qc index 4ee741d58..031ab5f96 100644 --- a/qcsrc/common/mapobjects/func/train.qc +++ b/qcsrc/common/mapobjects/func/train.qc @@ -186,7 +186,7 @@ float train_send(entity this, entity to, float sf) 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) diff --git a/qcsrc/common/mapobjects/misc/laser.qc b/qcsrc/common/mapobjects/misc/laser.qc index 76ebc0c40..6df58fb15 100644 --- a/qcsrc/common/mapobjects/misc/laser.qc +++ b/qcsrc/common/mapobjects/misc/laser.qc @@ -273,7 +273,7 @@ spawnfunc(misc_laser) this.mangle = this.angles; - Net_LinkEntity(this, false, 0, laser_SendEntity); + Net_LinkEntity(this, false, true, 0, laser_SendEntity); this.setactive = laser_setactive; diff --git a/qcsrc/common/mapobjects/misc/teleport_dest.qc b/qcsrc/common/mapobjects/misc/teleport_dest.qc index efc457409..dc93be3f6 100644 --- a/qcsrc/common/mapobjects/misc/teleport_dest.qc +++ b/qcsrc/common/mapobjects/misc/teleport_dest.qc @@ -22,7 +22,7 @@ bool teleport_dest_send(entity this, entity to, int sendflags) 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; } diff --git a/qcsrc/common/mapobjects/models.qc b/qcsrc/common/mapobjects/models.qc index 85a8ab843..15a6461dc 100644 --- a/qcsrc/common/mapobjects/models.qc +++ b/qcsrc/common/mapobjects/models.qc @@ -171,7 +171,7 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf) 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: diff --git a/qcsrc/common/mapobjects/target/music.qc b/qcsrc/common/mapobjects/target/music.qc index 30413c0c6..730d16de9 100644 --- a/qcsrc/common/mapobjects/target/music.qc +++ b/qcsrc/common/mapobjects/target/music.qc @@ -165,7 +165,7 @@ spawnfunc(trigger_music) 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) diff --git a/qcsrc/common/mapobjects/trigger/jumppads.qc b/qcsrc/common/mapobjects/trigger/jumppads.qc index 67bb65191..59fd0c553 100644 --- a/qcsrc/common/mapobjects/trigger/jumppads.qc +++ b/qcsrc/common/mapobjects/trigger/jumppads.qc @@ -649,7 +649,7 @@ void target_push_use(entity this, entity actor, entity trigger) 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 } diff --git a/qcsrc/common/mapobjects/trigger/keylock.qc b/qcsrc/common/mapobjects/trigger/keylock.qc index 368da3651..e66a6be82 100644 --- a/qcsrc/common/mapobjects/trigger/keylock.qc +++ b/qcsrc/common/mapobjects/trigger/keylock.qc @@ -105,7 +105,7 @@ bool trigger_keylock_send(entity this, entity to, int sf) 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) ? diff --git a/qcsrc/common/mapobjects/trigger/viewloc.qc b/qcsrc/common/mapobjects/trigger/viewloc.qc index 4679e75f7..3c53fe32a 100644 --- a/qcsrc/common/mapobjects/trigger/viewloc.qc +++ b/qcsrc/common/mapobjects/trigger/viewloc.qc @@ -104,7 +104,7 @@ void viewloc_init(entity this) 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; @@ -137,7 +137,7 @@ void viewloc_link(entity this) { 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) diff --git a/qcsrc/common/mapobjects/triggers.qc b/qcsrc/common/mapobjects/triggers.qc index 39fa89c42..a9ac7d3d5 100644 --- a/qcsrc/common/mapobjects/triggers.qc +++ b/qcsrc/common/mapobjects/triggers.qc @@ -127,8 +127,7 @@ void trigger_init(entity this) 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) diff --git a/qcsrc/common/minigames/minigame/bd.qc b/qcsrc/common/minigames/minigame/bd.qc index 635d1b8d5..d62ac4daf 100644 --- a/qcsrc/common/minigames/minigame/bd.qc +++ b/qcsrc/common/minigames/minigame/bd.qc @@ -583,7 +583,7 @@ void bd_setup_pieces(entity minigame) 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 } diff --git a/qcsrc/common/minigames/minigames.qc b/qcsrc/common/minigames/minigames.qc index 0455e8086..0f2d557e4 100644 --- a/qcsrc/common/minigames/minigames.qc +++ b/qcsrc/common/minigames/minigames.qc @@ -90,7 +90,7 @@ entity msle_spawn(entity minigame_session, entity e) 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; } diff --git a/qcsrc/common/minigames/sv_minigames.qc b/qcsrc/common/minigames/sv_minigames.qc index 57f6f46b6..3cce493aa 100644 --- a/qcsrc/common/minigames/sv_minigames.qc +++ b/qcsrc/common/minigames/sv_minigames.qc @@ -145,7 +145,7 @@ int minigame_addplayer(entity minigame_session, entity player) 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); @@ -181,7 +181,7 @@ entity start_minigame(entity player, string minigame ) 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; diff --git a/qcsrc/common/mutators/base.qh b/qcsrc/common/mutators/base.qh index 2b4d3e34c..7af5a12ce 100644 --- a/qcsrc/common/mutators/base.qh +++ b/qcsrc/common/mutators/base.qh @@ -228,7 +228,7 @@ bool Mutator_Add(Mutator mut) // 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; } diff --git a/qcsrc/common/mutators/mutator/damagetext/sv_damagetext.qc b/qcsrc/common/mutators/mutator/damagetext/sv_damagetext.qc index c9ded88f0..5748344b5 100644 --- a/qcsrc/common/mutators/mutator/damagetext/sv_damagetext.qc +++ b/qcsrc/common/mutators/mutator/damagetext/sv_damagetext.qc @@ -85,5 +85,5 @@ MUTATOR_HOOKFUNCTION(damagetext, PlayerDamaged) { 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); } diff --git a/qcsrc/common/mutators/mutator/nades/nades.qc b/qcsrc/common/mutators/mutator/nades/nades.qc index 5ea4cb49c..f64e5d329 100644 --- a/qcsrc/common/mutators/mutator/nades/nades.qc +++ b/qcsrc/common/mutators/mutator/nades/nades.qc @@ -572,7 +572,7 @@ entity nades_spawn_orb(entity own, entity realown, vector org, float orb_ltime, 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); diff --git a/qcsrc/common/mutators/mutator/physical_items/sv_physical_items.qc b/qcsrc/common/mutators/mutator/physical_items/sv_physical_items.qc index 328f79ac8..9dd062a9c 100644 --- a/qcsrc/common/mutators/mutator/physical_items/sv_physical_items.qc +++ b/qcsrc/common/mutators/mutator/physical_items/sv_physical_items.qc @@ -136,5 +136,5 @@ MUTATOR_HOOKFUNCTION(physical_items, Item_Spawn) 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); } diff --git a/qcsrc/common/mutators/mutator/status_effects/status_effects.qh b/qcsrc/common/mutators/mutator/status_effects/status_effects.qh index f7795094c..53518842a 100644 --- a/qcsrc/common/mutators/mutator/status_effects/status_effects.qh +++ b/qcsrc/common/mutators/mutator/status_effects/status_effects.qh @@ -143,7 +143,7 @@ void StatusEffects_new(entity this) 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; } diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 97c26f360..88c508229 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -1084,7 +1084,7 @@ entity WaypointSprite_Spawn( 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; } diff --git a/qcsrc/common/notifications/all.qc b/qcsrc/common/notifications/all.qc index e6fe8df76..0ba3fd41d 100644 --- a/qcsrc/common/notifications/all.qc +++ b/qcsrc/common/notifications/all.qc @@ -1507,7 +1507,7 @@ void Kill_Notification( 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), @@ -1668,7 +1668,7 @@ void Send_Notification( ? (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); } } diff --git a/qcsrc/common/turrets/sv_turrets.qc b/qcsrc/common/turrets/sv_turrets.qc index 2e6068bf5..18001df95 100644 --- a/qcsrc/common/turrets/sv_turrets.qc +++ b/qcsrc/common/turrets/sv_turrets.qc @@ -1194,7 +1194,7 @@ void turret_use(entity this, entity actor, entity trigger) 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; diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index 302b39a0d..1e0074211 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -59,7 +59,7 @@ void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, int axh_id) //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) diff --git a/qcsrc/common/vehicles/vehicle/bumblebee.qc b/qcsrc/common/vehicles/vehicle/bumblebee.qc index 8b34473e3..82c77692b 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee.qc +++ b/qcsrc/common/vehicles/vehicle/bumblebee.qc @@ -886,7 +886,7 @@ METHOD(Bumblebee, vr_spawn, void(Bumblebee thisveh, entity instance)) 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; diff --git a/qcsrc/common/vehicles/vehicle/racer.qc b/qcsrc/common/vehicles/vehicle/racer.qc index adffbfce0..d731411ca 100644 --- a/qcsrc/common/vehicles/vehicle/racer.qc +++ b/qcsrc/common/vehicles/vehicle/racer.qc @@ -571,7 +571,7 @@ METHOD(Racer, vr_spawn, void(Racer thisveh, entity instance)) 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; diff --git a/qcsrc/common/weapons/weapon/arc.qc b/qcsrc/common/weapons/weapon/arc.qc index 54e7d99bd..6f7f8780f 100644 --- a/qcsrc/common/weapons/weapon/arc.qc +++ b/qcsrc/common/weapons/weapon/arc.qc @@ -539,7 +539,7 @@ void W_Arc_Beam(float burst, entity actor, .entity weaponentity) 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); } diff --git a/qcsrc/common/weapons/weapon/tuba.qc b/qcsrc/common/weapons/weapon/tuba.qc index 43e5ca24e..bb1c015dd 100644 --- a/qcsrc/common/weapons/weapon/tuba.qc +++ b/qcsrc/common/weapons/weapon/tuba.qc @@ -294,7 +294,7 @@ void W_Tuba_NoteOn(entity actor, .entity weaponentity, float hittype) 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 diff --git a/qcsrc/common/wepent.qc b/qcsrc/common/wepent.qc index c673b0980..b9d48f6c0 100644 --- a/qcsrc/common/wepent.qc +++ b/qcsrc/common/wepent.qc @@ -164,7 +164,7 @@ MACRO_END 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 diff --git a/qcsrc/lib/csqcmodel/sv_model.qc b/qcsrc/lib/csqcmodel/sv_model.qc index 70e2c1a15..6d33d15a7 100644 --- a/qcsrc/lib/csqcmodel/sv_model.qc +++ b/qcsrc/lib/csqcmodel/sv_model.qc @@ -121,12 +121,11 @@ void CSQCModel_CheckUpdate(entity e) 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); } diff --git a/qcsrc/lib/net.qh b/qcsrc/lib/net.qh index c9cdf6981..5648d7982 100644 --- a/qcsrc/lib/net.qh +++ b/qcsrc/lib/net.qh @@ -115,7 +115,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); } 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 == "") { @@ -123,7 +123,7 @@ STATIC_INIT(C2S_Protocol_renumber) { FOREACH(C2S_Protocol, true, it.m_id = i); } 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; diff --git a/qcsrc/lib/warpzone/server.qc b/qcsrc/lib/warpzone/server.qc index 1bb1aeb6a..2b52e69de 100644 --- a/qcsrc/lib/warpzone/server.qc +++ b/qcsrc/lib/warpzone/server.qc @@ -161,14 +161,10 @@ float WarpZone_Teleport(entity wz, entity player, float f0, float f1) 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) @@ -716,9 +712,7 @@ spawnfunc(trigger_warpzone) 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; @@ -744,8 +738,7 @@ spawnfunc(func_camera) 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; } diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 2e6e9e6b8..3557ad10e 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -158,7 +158,7 @@ bool ClientData_Send(entity this, entity to, int sf) 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; } @@ -665,7 +665,7 @@ void PutPlayerInServer(entity 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); @@ -896,7 +896,7 @@ void ClientInit_Spawn() { 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); } diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc index 12e130c9e..446dbf466 100644 --- a/qcsrc/server/command/vote.qc +++ b/qcsrc/server/command/vote.qc @@ -97,7 +97,7 @@ bool Nagger_SendEntity(entity this, entity to, float sendflags) 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() diff --git a/qcsrc/server/elimination.qc b/qcsrc/server/elimination.qc index 28d102766..b207cd0c1 100644 --- a/qcsrc/server/elimination.qc +++ b/qcsrc/server/elimination.qc @@ -31,6 +31,6 @@ void EliminatedPlayers_Init(float(entity) isEliminated_func) 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; } diff --git a/qcsrc/server/hook.qc b/qcsrc/server/hook.qc index a50830348..989ca2366 100644 --- a/qcsrc/server/hook.qc +++ b/qcsrc/server/hook.qc @@ -414,7 +414,7 @@ void FireGrapplingHook(entity actor, .entity weaponentity) 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 diff --git a/qcsrc/server/items/items.qc b/qcsrc/server/items/items.qc index 99c0165fd..7d1c46f3f 100644 --- a/qcsrc/server/items/items.qc +++ b/qcsrc/server/items/items.qc @@ -1133,7 +1133,7 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default 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)) diff --git a/qcsrc/server/mapvoting.qc b/qcsrc/server/mapvoting.qc index 9242a5b6f..cbb9729c6 100644 --- a/qcsrc/server/mapvoting.qc +++ b/qcsrc/server/mapvoting.qc @@ -406,7 +406,7 @@ bool MapVote_SendEntity(entity this, entity to, int sf) 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() diff --git a/qcsrc/server/scores.qc b/qcsrc/server/scores.qc index b6244ee24..57c4cc406 100644 --- a/qcsrc/server/scores.qc +++ b/qcsrc/server/scores.qc @@ -99,7 +99,7 @@ void TeamScore_Spawn(float t, string name) 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); @@ -227,7 +227,7 @@ void ScoreInfo_Init(int teams) 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"); @@ -328,7 +328,7 @@ void PlayerScore_Attach(entity player) 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; } diff --git a/qcsrc/server/spawnpoints.qc b/qcsrc/server/spawnpoints.qc index ab0d2bea4..dbe15ee19 100644 --- a/qcsrc/server/spawnpoints.qc +++ b/qcsrc/server/spawnpoints.qc @@ -87,7 +87,7 @@ void link_spawnpoint(entity this) // 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) diff --git a/qcsrc/server/weapons/accuracy.qc b/qcsrc/server/weapons/accuracy.qc index 150d480ec..892350c27 100644 --- a/qcsrc/server/weapons/accuracy.qc +++ b/qcsrc/server/weapons/accuracy.qc @@ -47,7 +47,7 @@ void accuracy_init(entity e) 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) diff --git a/qcsrc/server/weapons/csqcprojectile.qc b/qcsrc/server/weapons/csqcprojectile.qc index 07f6f5c66..7170d3ed6 100644 --- a/qcsrc/server/weapons/csqcprojectile.qc +++ b/qcsrc/server/weapons/csqcprojectile.qc @@ -79,7 +79,7 @@ void CSQCProjectile_Check(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; diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index 41c9705da..593b31f9d 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -570,7 +570,7 @@ void RandomSeed_Spawn() { 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 }