From 2b8b7bd6a388e58ff48765d25d9f6db579fceaa1 Mon Sep 17 00:00:00 2001 From: ESwordTheCat Date: Sun, 4 May 2014 10:20:11 -0800 Subject: [PATCH] Little changes to object pool system. --- code/__HELPERS/experimental.dm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/__HELPERS/experimental.dm b/code/__HELPERS/experimental.dm index 339f86ccc81..993feb2d14a 100644 --- a/code/__HELPERS/experimental.dm +++ b/code/__HELPERS/experimental.dm @@ -49,7 +49,7 @@ */ // Uncomment to show debug messages. -//#define DEBUG_OBJECT_POOL +#define DEBUG_OBJECT_POOL #define MAINTAINING_OBJECT_POOL_COUNT 20 @@ -99,7 +99,6 @@ var/list/masterPool = list() var/atom/movable/Object = A Object.resetVariables() - Object.loc = null switch(length(masterPool[Object.type])) if (MAINTAINING_OBJECT_POOL_COUNT to 1.#INF) @@ -108,7 +107,7 @@ var/list/masterPool = list() #endif return - if (0) + if (0) // In a numeric context (like a mathematical operation), null evaluates to 0. #ifdef DEBUG_OBJECT_POOL world << "DEBUG_OBJECT_POOL: [Object.type] pool is empty, recreating pool." #endif @@ -143,3 +142,5 @@ var/list/masterPool = list() for (key in varsCopy) vars[key] = initial(vars[key]) + + vars["loc"] = null // Making sure the loc is null not a compile-time var value.