mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
Small ZAS Optimization
Minor optimization; eliminates a few proc calls when managing zone connections by turning check() into a macro.
This commit is contained in:
@@ -24,12 +24,16 @@ Class Procs:
|
|||||||
erase_all()
|
erase_all()
|
||||||
Called when the turf is changed with ChangeTurf(). Erases all existing connections.
|
Called when the turf is changed with ChangeTurf(). Erases all existing connections.
|
||||||
|
|
||||||
|
Macros:
|
||||||
check(connection/c)
|
check(connection/c)
|
||||||
Checks for connection validity. It's possible to have a reference to a connection that has been erased.
|
Checks for connection validity. It's possible to have a reference to a connection that has been erased.
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// macro-ized to cut down on proc calls
|
||||||
|
#define check(c) (c && c.valid())
|
||||||
|
|
||||||
/turf/var/tmp/connection_manager/connections
|
/turf/var/tmp/connection_manager/connections
|
||||||
|
|
||||||
/connection_manager/var/connection/N
|
/connection_manager/var/connection/N
|
||||||
@@ -98,5 +102,4 @@ Class Procs:
|
|||||||
if(check(D)) D.erase()
|
if(check(D)) D.erase()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/connection_manager/proc/check(connection/c)
|
#undef check
|
||||||
return c && c.valid()
|
|
||||||
|
|||||||
Reference in New Issue
Block a user