Fix runtime error.

This commit is contained in:
ESwordTheCat
2014-04-07 07:46:44 +08:00
committed by ZomgPonies
parent dde219a581
commit 1cb513e29b
+7 -5
View File
@@ -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