From: terencehill Date: Mon, 20 Feb 2023 20:58:08 +0000 (+0100) Subject: Fix a few cases of networked entities labeled as pure X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fheads%2Fterencehill%2Fpure_entities_fix;p=xonotic%2Fxonotic-data.pk3dir.git Fix a few cases of networked entities labeled as pure --- diff --git a/qcsrc/common/effects/qc/damageeffects.qc b/qcsrc/common/effects/qc/damageeffects.qc index 1d8b6c53c..d6684f4cf 100644 --- a/qcsrc/common/effects/qc/damageeffects.qc +++ b/qcsrc/common/effects/qc/damageeffects.qc @@ -28,7 +28,7 @@ void Damage_DamageInfo(vector org, bool is_solid_hit, float coredamage, float ed if(!sound_allowed(MSG_BROADCAST, dmgowner)) deathtype |= 0x8000; - e = new_pure(damageinfo); + e = new(damageinfo); // origin is just data to be sent //setorigin(e, org); e.origin = org; diff --git a/qcsrc/common/ent_cs.qc b/qcsrc/common/ent_cs.qc index 85119de08..9c3bc9768 100644 --- a/qcsrc/common/ent_cs.qc +++ b/qcsrc/common/ent_cs.qc @@ -241,7 +241,7 @@ ENTCS_PROP(SOLID, true, sv_solid, solid, ENTCS_SET_NORMAL, void entcs_attach(entity player) { - entity e = CS(player).entcs = new_pure(entcs_sender); + entity e = CS(player).entcs = new(entcs_sender); e.owner = player; setthink(e, entcs_think); e.nextthink = time; diff --git a/qcsrc/common/wepent.qc b/qcsrc/common/wepent.qc index c673b0980..da2b0539d 100644 --- a/qcsrc/common/wepent.qc +++ b/qcsrc/common/wepent.qc @@ -158,7 +158,7 @@ MACRO_END void wepent_link(entity wep) { - entity e = new_pure(wepent_sender); + entity e = new(wepent_sender); e.owner = wep; setthink(e, wepent_think); e.nextthink = time; diff --git a/qcsrc/lib/oo.qh b/qcsrc/lib/oo.qh index a2cef664b..008ede42c 100644 --- a/qcsrc/lib/oo.qh +++ b/qcsrc/lib/oo.qh @@ -6,6 +6,9 @@ .vector origin; +// entities can be labeled pure if they aren't linked to the world +// that is, if they never call setorigin / setsize / setmodel (/ Net_LinkEntity) + .bool pure_data; #define is_pure(e) ((e).pure_data) /** @deprecated use new_pure or NEW(class) */ diff --git a/qcsrc/lib/warpzone/common.qc b/qcsrc/lib/warpzone/common.qc index 0c85d4a08..b4eccd0bf 100644 --- a/qcsrc/lib/warpzone/common.qc +++ b/qcsrc/lib/warpzone/common.qc @@ -580,13 +580,17 @@ bool WarpZoneLib_BadEntity(entity e) switch(s) { case "weaponentity": + case "eliminatedPlayers": case "exteriorweaponentity": + case "entcs_sender": + case "damageinfo": case "sprite_waypoint": case "waypoint": case "spawnfunc": case "weaponchild": case "chatbubbleentity": case "buff_model": + case "wepent_sender": //case "net_linked": // actually some real entities are linked without classname, fail case "": return true; diff --git a/qcsrc/server/elimination.qc b/qcsrc/server/elimination.qc index 28d102766..a2d949985 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(eliminatedPlayers), false, 0, EliminatedPlayers_SendEntity); eliminatedPlayers.isEliminated = isEliminated_func; }