]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix a few cases of networked entities labeled as pure terencehill/pure_entities_fix
authorterencehill <piuntn@gmail.com>
Mon, 20 Feb 2023 20:58:08 +0000 (21:58 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 20 Feb 2023 20:58:08 +0000 (21:58 +0100)
qcsrc/common/effects/qc/damageeffects.qc
qcsrc/common/ent_cs.qc
qcsrc/common/wepent.qc
qcsrc/lib/oo.qh
qcsrc/lib/warpzone/common.qc
qcsrc/server/elimination.qc

index 1d8b6c53c57052976304ca25589232004bc1d63b..d6684f4cf1d39c31d226bf37596ad86c1a7c7c11 100644 (file)
@@ -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;
index 85119de08825c52ab9c6692d87d4d9a3eb9fd83b..9c3bc97684980a245d56fcd1e0abbe61bab695e6 100644 (file)
@@ -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;
index c673b0980781e3b700a549c35936c4c067edfb62..da2b0539d05cf410ee743ff0e26003a2d5b37761 100644 (file)
@@ -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;
index a2cef664bad3b72f9936ab371b12087c1e362027..008ede42c8cbf155a69f1645b9be45b485a6b28b 100644 (file)
@@ -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) */
index 0c85d4a088522cce87bbd09fa6b7a2f95ff4f60f..b4eccd0bf544386df0a54eb7267f80c5364fe9ff 100644 (file)
@@ -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;
index 28d10276625b8682f13bbce233eafe7986b06143..a2d9499854aec8aeaa93b6eb538d50b8fd25d188 100644 (file)
@@ -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;
 }