From ea15a83fde8de59f450211f79598781dfc462a0b Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Mon, 23 Jan 2017 01:56:47 -0500 Subject: [PATCH] Fires all Lifeguards, Bans Diving, Forbids Swimming, and Restricts Water Useage --- code/__DEFINES/qdel.dm | 3 +- .../garbage_collection/garbage_collector.dm | 2 - code/modules/pooling/pool.dm | 125 ------------------ .../projectiles/guns/projectile/saw.dm | 2 +- paradise.dme | 1 - 5 files changed, 2 insertions(+), 131 deletions(-) delete mode 100644 code/modules/pooling/pool.dm diff --git a/code/__DEFINES/qdel.dm b/code/__DEFINES/qdel.dm index b623ce72158..492918be671 100644 --- a/code/__DEFINES/qdel.dm +++ b/code/__DEFINES/qdel.dm @@ -4,8 +4,7 @@ #define QDEL_HINT_LETMELIVE 1 //qdel should let the object live after calling destory. #define QDEL_HINT_IWILLGC 2 //functionally the same as the above. qdel should assume the object will gc on its own, and not check it. #define QDEL_HINT_HARDDEL_NOW 4 //qdel should assume this object won't gc, and hard del it post haste. -#define QDEL_HINT_PUTINPOOL 5 //qdel will put this object in the atom pool. -#define QDEL_HINT_FINDREFERENCE 6 //functionally identical to QDEL_HINT_QUEUE if TESTING is not enabled in _compiler_options.dm. +#define QDEL_HINT_FINDREFERENCE 5 //functionally identical to QDEL_HINT_QUEUE if TESTING is not enabled in _compiler_options.dm. //if TESTING is enabled, qdel will call this object's find_references() verb. // A convenient wrapper around checking for qdeletion/non-existence diff --git a/code/modules/garbage_collection/garbage_collector.dm b/code/modules/garbage_collection/garbage_collector.dm index 3d6007d313e..e2204788016 100644 --- a/code/modules/garbage_collection/garbage_collector.dm +++ b/code/modules/garbage_collection/garbage_collector.dm @@ -149,8 +149,6 @@ var/global/datum/controller/process/garbage_collector/garbageCollector del(D) if(garbageCollector) garbageCollector.dels_count++ - if(QDEL_HINT_PUTINPOOL) //qdel will put this object in the pool. - PlaceInPool(D,0) if(QDEL_HINT_FINDREFERENCE)//qdel will, if TESTING is enabled, display all references to this object, then queue the object for deletion. #ifdef TESTING D.find_references(remove_from_queue = FALSE) diff --git a/code/modules/pooling/pool.dm b/code/modules/pooling/pool.dm deleted file mode 100644 index 2d769a020cb..00000000000 --- a/code/modules/pooling/pool.dm +++ /dev/null @@ -1,125 +0,0 @@ - -/* -/tg/station13 /datum Pool: ---------------------------------- -By RemieRichards - -Creation/Deletion is laggy, so let's reduce reuse and recycle! - -Usage: - -To get a object, just call - - PoolOrNew(type, arg) if you only want to pass one argument to New(), usually loc - - PoolOrNew(type, list) if you want to pass multiple arguments to New() - -To put a object back in the pool, call PlaceInPool(object) -This will call destroy on the object, set its loc to null, -and reset all of its vars to their default - -You can override your object's destroy to return QDEL_HINT_PUTINPOOL -to ensure its always placed in this pool (this will only be acted on if qdel calls destroy, and destroy will not get called twice) - -For almost all pooling purposes, it is better to use the QDEL hint than to pool it directly with PlaceInPool - -*/ - -var/global/list/GlobalPool = list() - -//You'll be using this proc 90% of the time. -//It grabs a type from the pool if it can -//And if it can't, it creates one -//The pool is flexible and will expand to fit -//The new created atom when it eventually -//Goes into the pool - -//Second argument can be a single arg -//Or a list of arguments -//Either way it gets passed to new - -/proc/PoolOrNew(get_type,second_arg) - if(!get_type) - return - - . = GetFromPool(get_type,second_arg) - - if(!.) - if(ispath(get_type)) - if(islist(second_arg)) - . = new get_type (arglist(second_arg)) - else - . = new get_type (second_arg) - - -/proc/GetFromPool(get_type,second_arg) - if(!get_type) - return - - if(isnull(GlobalPool[get_type])) - return - - if(length(GlobalPool[get_type]) == 0) - return - - var/datum/pooled = pop(GlobalPool[get_type]) - if(pooled) - var/atom/movable/AM - if(istype(pooled, /atom/movable)) - AM = pooled - - if(islist(second_arg)) - if(AM) - AM.loc = second_arg[1] //we need to do loc setting explicetly before even calling New() to replicate new()'s behavior - pooled.New(arglist(second_arg)) - - else - if(AM) - AM.loc = second_arg - pooled.New(second_arg) - - return pooled - - -/proc/PlaceInPool(datum/diver, destroy = 1) - if(!istype(diver)) - return - - if(diver in GlobalPool[diver.type]) - return - - if(!GlobalPool[diver.type]) - GlobalPool[diver.type] = list() - - GlobalPool[diver.type] |= diver - - if(destroy) - diver.Destroy() - - diver.ResetVars() - -var/list/exclude = list("animate_movement", "contents", "loc", "locs", "parent_type", "vars", "verbs", "type") -var/list/pooledvariables = list() -//thanks to clusterfack @ /vg/station for these two procs -/datum/proc/createVariables() - pooledvariables[type] = new/list() - var/list/exclude = global.exclude + args - - for(var/key in vars) - if(key in exclude) - continue - pooledvariables[type][key] = initial(vars[key]) - -/datum/proc/ResetVars() - if(!pooledvariables[type]) - createVariables(args) - - for(var/key in pooledvariables[type]) - vars[key] = pooledvariables[type][key] - -/atom/movable/ResetVars() - ..() - loc = null - contents = initial(contents) //something is really wrong if this object still has stuff in it by this point - -/image/ResetVars() - ..() - loc = null diff --git a/code/modules/projectiles/guns/projectile/saw.dm b/code/modules/projectiles/guns/projectile/saw.dm index d36ad1dd2c6..72e4bacebab 100644 --- a/code/modules/projectiles/guns/projectile/saw.dm +++ b/code/modules/projectiles/guns/projectile/saw.dm @@ -87,7 +87,7 @@ obj/item/projectile/bullet/saw/incen/Move() ..() var/turf/location = get_turf(src) if(location) - PoolOrNew(/obj/effect/hotspot, location) + new /obj/effect/hotspot(location) location.hotspot_expose(700, 50, 1) /obj/item/projectile/bullet/saw/incen/on_hit(atom/target, blocked = 0) diff --git a/paradise.dme b/paradise.dme index 93d922f35fc..32af7f4a763 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1759,7 +1759,6 @@ #include "code\modules\pda\radio.dm" #include "code\modules\pda\utilities.dm" #include "code\modules\persistence\persistence.dm" -#include "code\modules\pooling\pool.dm" #include "code\modules\power\apc.dm" #include "code\modules\power\cable.dm" #include "code\modules\power\cable_heavyduty.dm"