From fdd889e9ffff90d48da11cc0bbebb792935fcb9c Mon Sep 17 00:00:00 2001 From: ESwordTheCat Date: Mon, 7 Apr 2014 22:16:56 +0800 Subject: [PATCH] Introduce resetVariables proc. --- code/__HELPERS/experimental.dm | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/code/__HELPERS/experimental.dm b/code/__HELPERS/experimental.dm index 5e7d7ddb65b..90e2553c19b 100644 --- a/code/__HELPERS/experimental.dm +++ b/code/__HELPERS/experimental.dm @@ -69,8 +69,10 @@ var/list/masterPool /* * @args - * A, type path + * A, type not object instance * B, loc + * + * Example call: getFromPool(/obj/item/weapon/shard, loc) */ /proc/getFromPool(A, B) if (isnull(masterPool[A])) @@ -93,7 +95,9 @@ var/list/masterPool /* * @args - * A, datum + * A, object instance not type + * + * Example call: returnToPool(src) */ /proc/returnToPool(atom/movable/A) if (isnull(masterPool[A])) @@ -105,10 +109,19 @@ var/list/masterPool var /atom/movable/Object = A Object.loc = null + Object.resetVariables() + masterPool[A.type] = masterPool[A.type] + Object - #if DEBUG_POOL_OBJECT + #if DEBUG_OBJECT_POOL world << "DEBUG_OBJECT_POOL: returnToPool([A]) [length(masterPool[A])]" #endif #undef DEBUG_OBJECT_POOL + +/* + * Override this if the object variables needed to reset. + * + * Example: see, code\game\objects\structures\grille.dm + */ +/atom/movable/proc/resetVariables()