From 1cb513e29b08ff6438ec47cb8a57654eaa6cca8a Mon Sep 17 00:00:00 2001 From: ESwordTheCat Date: Mon, 7 Apr 2014 07:46:44 +0800 Subject: [PATCH] Fix runtime error. --- code/__HELPERS/experimental.dm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/__HELPERS/experimental.dm b/code/__HELPERS/experimental.dm index 4b5a6386c02..8a2872acbbe 100644 --- a/code/__HELPERS/experimental.dm +++ b/code/__HELPERS/experimental.dm @@ -47,15 +47,16 @@ var/list/plasmaShardPool /* * @args - * A, datum + * A, type path */ -/proc/getFromPool(datum/A) - switch (A.type) +#define FIRST_OBJECT 1 +/proc/getFromPool(A) + switch (A) if (/obj/item/weapon/shard) if (isnull(shardPool)) return new /obj/item/weapon/shard() - . = shardPool[1] + . = shardPool[FIRST_OBJECT] shardPool = shardPool - . if (0 == shardPool.len) @@ -64,11 +65,12 @@ var/list/plasmaShardPool if (isnull(plasmaShardPool)) return new /obj/item/weapon/shard/plasma() - . = plasmaShardPool[1] + . = plasmaShardPool[FIRST_OBJECT] plasmaShardPool = plasmaShardPool - . if (0 == plasmaShardPool.len) plasmaShardPool = null +#undef FIRST_OBJECT /* * @args