]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't link pure entities to the area grid in DP master
authorbones_was_here <bones_was_here@xonotic.au>
Thu, 6 Apr 2023 17:02:46 +0000 (03:02 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Thu, 6 Apr 2023 17:02:46 +0000 (03:02 +1000)
This is important for performance.

qcsrc/lib/oo.qh
xonotic-client.cfg
xonotic-server.cfg

index 9048202fe28f1da4b5ce0fb753cda1b6aca830b1..5960287bf2ec91ba771a2e91350ea66a432b4d98 100644 (file)
@@ -4,17 +4,23 @@
 #include "nil.qh"
 #include "static.qh"
 
-.vector origin;
-
+// pure entities: not linked to the area grid
+// see: sv_areagrid_link_SOLID_NOT and cl_areagrid_link_SOLID_NOT
 .bool pure_data;
-#define is_pure(e) ((e).pure_data)
-/** @deprecated use new_pure or NEW(class) */
-#define make_pure(e) MACRO_BEGIN \
-       (e).pure_data = true; \
-MACRO_END
-#define make_impure(e) MACRO_BEGIN \
-       (e).pure_data = false; \
-MACRO_END
+
+#ifdef GAMEQC
+       /** direct use is @deprecated use new_pure or NEW(class) */
+       #define make_pure(e) \
+               (e).pure_data = true; \
+               (e).solid = SOLID_NOT;
+       #define is_pure(e) ((e).pure_data && (e).solid == SOLID_NOT)
+#else
+       #define make_pure(e) \
+               (e).pure_data = true;
+       #define is_pure(e) ((e).pure_data)
+#endif // GAMEQC
+#define make_impure(e) \
+       (e).pure_data = false;
 
 .string classname;
 /** Location entity was spawned from in source */
@@ -25,7 +31,6 @@ entity _spawn();
 #define SPAWN_PURE 0
 #endif
 
-// pure entities: need no .origin
 #if SPAWN_PURE
 entity spawn_pure() = #600;
 #else
@@ -56,9 +61,9 @@ entity __spawn(string _classname, string _sourceLoc, bool pure)
        #define classfield(name) [[class(name)]]
        #define _new(class, pure) ((class) __spawn(#class, __FILE__ ":" STR(__LINE__), pure))
 #endif
-/** entities you care about seeing (.origin works) */
+/** entities you care about collisions with */
 #define new(class) _new(class, false)
-/** purely logical entities (.origin doesn't work) */
+/** purely logical entities (not linked to the area grid) */
 #define new_pure(class) _new(class, true)
 #define spawn() __spawn("entity", __FILE__ ":" STR(__LINE__), false)
 
index 22792e06ef6e6e15bb011be78d95f9d59dd1940c..46149e2d108a9985d25539c76e3fbc858ca0cec8 100644 (file)
@@ -919,3 +919,6 @@ set cl_rollkillspeed 10
 // Interpreted in post-config.cfg.
 seta menu_forced_saved_cvars "" "These cvars will always be saved, despite engine/Xonotic cvar saving status"
 set menu_reverted_nonsaved_cvars "" "These cvars are currently marked as saved in the flags, but have been reverted and won't stay saved. INTERNAL USE ONLY."
+
+// Avoid perf problems near '0 0 0'; `set` without a description is because only current DP has this engine cvar
+set cl_areagrid_link_SOLID_NOT 0
index 82cccae0f3b324fdcf0ce8ee999962c54772f483..94532425fecf63013af480dd795a2ada350a446f 100644 (file)
@@ -598,3 +598,6 @@ set sv_warpzone_allow_selftarget 0 "do not touch"
 sv_disablenotify 1
 
 set sv_quickmenu_file "" "filename of a custom server's quickmenu that will be selectable from the default client's quickmenu. This file must be sent in a pk3 archive and should have an unique name (e.g. quickmenu-servername.txt) to prevent overriding existing quickmenus"
+
+// Avoid perf problems near '0 0 0'; `set` without a description is because only current DP has this engine cvar
+set sv_areagrid_link_SOLID_NOT 0