Grinder Fix, Botany qdel Refactor, Removes PanDEMIC2200

Fixes the reagent grinder machines not properly grinding tomato into
ketchup and rice into rice

Updates botany code to use qdel over del to help alleviate potential lag
from del calls

Removes the PanDEMIC 2200 board from Tech Storage and the Circuit
Imprinter, as the computer it builds has been commented out for a long
time. Also deletes the commented out code (over 250 lines of commented
out code deleted)
This commit is contained in:
FalseIncarnate
2015-07-01 22:09:37 -04:00
parent 1120127233
commit 27f4ccda36
15 changed files with 66 additions and 344 deletions
+18 -18
View File
@@ -29,7 +29,7 @@
sleep(250) // ugly hack, should mean roundstart plants are fine.
if(!plant_controller)
world << "<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>"
del(src)
qdel(src)
return
seed = plant_controller.seeds[plantname]
@@ -80,7 +80,7 @@
sleep(250) // ugly hack, should mean roundstart plants are fine.
if(!plant_controller)
world << "<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>"
del(src)
qdel(src)
return
if(plant_controller.product_descs["[seed.uid]"])
@@ -178,7 +178,7 @@
M.Weaken(5)
seed.thrown_at(src,M)
sleep(-1)
if(src) del(src)
if(src) qdel(src)
return
/obj/item/weapon/reagent_containers/food/snacks/grown/throw_impact(atom/hit_atom)
@@ -198,7 +198,7 @@
user.put_in_hands(pocell)
pocell.maxcharge = src.potency * 10
pocell.charge = pocell.maxcharge
del(src)
qdel(src)
return
else if(W.sharp)
var/reagents_per_slice
@@ -206,21 +206,21 @@
if(seed.kitchen_tag == "pumpkin") // Ugggh these checks are awful.
user.show_message("<span class='notice'>You carve a face into [src]!</span>", 1)
new /obj/item/clothing/head/hardhat/pumpkinhead (user.loc)
del(src)
qdel(src)
return
else if(seed.kitchen_tag == "potato")
user << "You slice \the [src] into sticks."
reagents_per_slice = reagents.total_volume
slice = new /obj/item/weapon/reagent_containers/food/snacks/rawsticks(get_turf(src))
reagents.trans_to(slice, reagents_per_slice)
del(src)
qdel(src)
return
else if(seed.kitchen_tag == "carrot")
user << "You slice \the [src] into sticks."
reagents_per_slice = reagents.total_volume
slice = new /obj/item/weapon/reagent_containers/food/snacks/carrotfries(get_turf(src))
reagents.trans_to(slice, reagents_per_slice)
del(src)
qdel(src)
return
else if(seed.kitchen_tag == "watermelon")
user << "You slice \the [src] into large slices."
@@ -228,14 +228,14 @@
for(var/i=0,i<5,i++)
slice = new /obj/item/weapon/reagent_containers/food/snacks/watermelonslice(get_turf(src))
reagents.trans_to(slice, reagents_per_slice)
del(src)
qdel(src)
return
else if(seed.kitchen_tag == "soybeans")
user << "You roughly chop up \the [src]."
reagents_per_slice = reagents.total_volume
slice = new /obj/item/weapon/reagent_containers/food/snacks/soydope(get_turf(src))
reagents.trans_to(slice, reagents_per_slice)
del(src)
qdel(src)
return
else if(seed.chems)
if(istype(W,/obj/item/weapon/hatchet) && !isnull(seed.chems["woodpulp"]))
@@ -250,7 +250,7 @@
continue
G.attackby(NG, user)
user << "You add the newly-formed wood to the stack. It now contains [NG.amount] planks."
del(src)
qdel(src)
return
else if(istype(W, /obj/item/weapon/rollingpaper))
if(seed.kitchen_tag == "ambrosia" || seed.kitchen_tag == "ambrosiadeus" || seed.kitchen_tag == "tobacco" || seed.kitchen_tag == "stobacco")
@@ -259,22 +259,22 @@
var/obj/item/clothing/mask/cigarette/joint/J = new /obj/item/clothing/mask/cigarette/joint(user.loc)
J.chem_volume = src.reagents.total_volume
src.reagents.trans_to(J, J.chem_volume)
del(W)
qdel(W)
user.put_in_active_hand(J)
else if(seed.kitchen_tag == "ambrosiadeus")
var/obj/item/clothing/mask/cigarette/joint/deus/J = new /obj/item/clothing/mask/cigarette/joint/deus(user.loc)
J.chem_volume = src.reagents.total_volume
src.reagents.trans_to(J, J.chem_volume)
del(W)
qdel(W)
user.put_in_active_hand(J)
else if(seed.kitchen_tag == "tobacco" || seed.kitchen_tag == "stobacco")
var/obj/item/clothing/mask/cigarette/handroll/J = new /obj/item/clothing/mask/cigarette/handroll(user.loc)
J.chem_volume = src.reagents.total_volume
src.reagents.trans_to(J, J.chem_volume)
del(W)
qdel(W)
user.put_in_active_hand(J)
user << "\blue You roll the [src] into a rolling paper."
del(src)
qdel(src)
else
user << "\red You can't roll a smokable from the [src]."
@@ -333,7 +333,7 @@
if(user)
user << "<span class='danger'>\The [src] has fallen to bits.</span>"
//user.drop_from_inventory(src)
del(src)
qdel(src)
add_fingerprint(user)
return 1
@@ -353,7 +353,7 @@
user.visible_message("<span class='danger'>\The [user] squashes \the [src]!</span>")
seed.thrown_at(src,user)
sleep(-1)
if(src) del(src)
if(src) qdel(src)
return
if(seed.kitchen_tag == "grass")
@@ -368,14 +368,14 @@
continue
NG.attackby(G, user)
user << "You add the newly-formed grass to the stack. It now contains [G.amount] tiles."
del(src)
qdel(src)
return
if(seed.get_trait(TRAIT_SPREAD) > 0)
user << "<span class='notice'>You plant the [src.name].</span>"
new /obj/machinery/portable_atmospherics/hydroponics/soil/invisible(get_turf(user),src.seed)
new /obj/effect/plant(get_turf(user), src.seed)
del(src)
qdel(src)
return
/*
+1 -1
View File
@@ -71,7 +71,7 @@
if(istype(W, /obj/item/weapon/circular_saw) || istype(W, /obj/item/weapon/hatchet) || istype(W, /obj/item/weapon/kitchen/utensil/knife) || istype(W, /obj/item/weapon/kitchenknife) || istype(W, /obj/item/weapon/kitchenknife/ritual))
user << "<span class='notice'>You use [W] to fashion a pipe out of the corn cob!</span>"
new /obj/item/clothing/mask/cigarette/pipe/cobpipe (user.loc)
del(src)
qdel(src)
return
/obj/item/weapon/bananapeel
+3 -3
View File
@@ -103,7 +103,7 @@
if(!istype(target))
if(istype(target, /mob/living/simple_animal/mouse) || istype(target, /mob/living/simple_animal/lizard))
new /obj/effect/decal/cleanable/blood/splatter(get_turf(target))
del(target)
qdel(target)
return
@@ -228,7 +228,7 @@
apply_special_effect(M)
splatter(T,thrown)
origin_turf.visible_message("<span class='danger'>The [thrown.name] explodes!</span>")
del(thrown)
qdel(thrown)
return
if(istype(target,/mob/living))
@@ -241,7 +241,7 @@
if(get_trait(TRAIT_JUICY) && splatted)
splatter(origin_turf,thrown)
origin_turf.visible_message("<span class='danger'>The [thrown.name] splatters against [target]!</span>")
del(thrown)
qdel(thrown)
/datum/seed/proc/handle_environment(var/turf/current_turf, var/datum/gas_mixture/environment, var/light_supplied, var/obj/item/weapon/tank/holding, var/check_only)
+2 -2
View File
@@ -37,7 +37,7 @@ var/global/datum/controller/plants/plant_controller // Set in New().
/datum/controller/plants/New()
if(plant_controller && plant_controller != src)
log_debug("Rebuilding plant controller.")
del(plant_controller)
qdel(plant_controller)
plant_controller = src
setup()
process()
@@ -136,7 +136,7 @@ var/global/datum/controller/plants/plant_controller // Set in New().
break
var/obj/effect/plant/plant = pick(plant_queue)
plant_queue -= plant
if(!istype(plant))
if(!istype(plant) || !isnull(plant.gcDestroyed))
continue
plant.process()
processed++
+1 -1
View File
@@ -224,7 +224,7 @@
genetics = seed.seed
degradation = 0
del(seed)
qdel(seed)
seed = null
if(href_list["get_gene"])
+4 -4
View File
@@ -188,16 +188,16 @@
N.seeds -= O
if (N.amount <= 0 || N.seeds.len <= 0)
piles -= N
del(N)
qdel(N)
O.loc = src.loc
else
piles -= N
del(N)
qdel(N)
else if (task == "purge")
for (var/obj/O in N.seeds)
del(O)
qdel(O)
piles -= N
del(N)
qdel(N)
break
updateUsrDialog()
@@ -32,13 +32,13 @@
color = DEAD_PLANT_COLOUR
/obj/effect/dead_plant/attack_hand()
del(src)
qdel(src)
/obj/effect/dead_plant/attackby()
..()
for(var/obj/effect/plant/neighbor in range(1))
neighbor.update_neighbors()
del(src)
qdel(src)
/obj/effect/plant
name = "plant"
@@ -70,12 +70,12 @@
var/mob/living/buckled_mob = null
var/movable = 0
/obj/effect/plant/Del()
/obj/effect/plant/Destroy()
if(plant_controller)
plant_controller.remove_plant(src)
for(var/obj/effect/plant/neighbor in range(1,src))
plant_controller.add_plant(neighbor)
..()
return ..()
/obj/effect/plant/single
spread_chance = 0
@@ -91,14 +91,14 @@
sleep(250) // ugly hack, should mean roundstart plants are fine.
if(!plant_controller)
world << "<span class='danger'>Plant controller does not exist and [src] requires it. Aborting.</span>"
del(src)
qdel(src)
return
if(!istype(newseed))
newseed = plant_controller.seeds[DEFAULT_SEED]
seed = newseed
if(!seed)
del(src)
qdel(src)
return
name = seed.display_name
@@ -104,6 +104,6 @@
for(var/obj/effect/plant/neighbor in check_turf.contents)
neighbor.neighbors |= check_turf
plant_controller.add_plant(neighbor)
spawn(1) if(src) del(src)
spawn(1) if(src) qdel(src)
#undef NEIGHBOR_REFRESH_TIME
+6 -6
View File
@@ -574,7 +574,7 @@
weedlevel -= P.weed_kill_str
user << "You spray [src] with [O]."
playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6)
del(O)
qdel(O)
check_level_sanity()
update_icon()
@@ -587,7 +587,7 @@
weedlevel -= W.weed_kill_str
user << "You spray [src] with [O]."
playsound(loc, 'sound/effects/spray3.ogg', 50, 1, -6)
del(O)
qdel(O)
check_level_sanity()
update_icon()
@@ -682,7 +682,7 @@
if(!S.seed)
user << "The packet seems to be empty. You throw it away."
del(O)
qdel(O)
return
user << "You plant the [S.seed.seed_name] [S.seed.seed_noun]."
@@ -693,7 +693,7 @@
health = (istype(S, /obj/item/seeds/cutting) ? round(seed.get_trait(TRAIT_ENDURANCE)/rand(2,5)) : seed.get_trait(TRAIT_ENDURANCE))
lastcycle = world.time
del(O)
qdel(O)
check_health()
@@ -735,13 +735,13 @@
user << "<span class='danger'>[src] is already occupied!</span>"
else
user.drop_item()
del(O)
qdel(O)
var/obj/machinery/apiary/A = new(src.loc)
A.icon = src.icon
A.icon_state = src.icon_state
A.hydrotray_type = src.type
del(src)
qdel(src)
else if ((istype(O, /obj/item/weapon/tank) && !( src.destroyed )))
if (src.holding)
user << "\blue There is alreadu a tank loaded into the [src]."
@@ -51,7 +51,7 @@
health = 10
nutrilevel += 10
user.drop_item()
del(O)
qdel(O)
user << "\blue You carefully insert the queen into [src], she gets busy making a hive."
bees_in_hive = 0
else if(istype(O, /obj/item/beezeez))
@@ -62,7 +62,7 @@
user << "\blue You insert [O] into [src]. A relaxed humming appears to pick up."
else
user << "\blue You insert [O] into [src]. Now it just needs some bees."
del(O)
qdel(O)
else if(istype(O, /obj/item/weapon/minihoe))
if(health > 0)
user << "\red <b>You begin to dislodge the apiary from the tray, the bees don't like that.</b>"
@@ -73,7 +73,7 @@
new hydrotray_type(src.loc)
new /obj/item/apiary(src.loc)
user << "\red You dislodge the apiary from the tray."
del(src)
qdel(src)
else if(istype(O, /obj/item/weapon/bee_net))
var/obj/item/weapon/bee_net/N = O
if(N.caught_bees > 0)
@@ -115,11 +115,11 @@
if(swarming <= 0)
for(var/mob/living/simple_animal/bee/B in src.loc)
bees_in_hive += B.strength
del(B)
qdel(B)
else if(bees_in_hive < 10)
for(var/mob/living/simple_animal/bee/B in src.loc)
bees_in_hive += B.strength
del(B)
qdel(B)
if(world.time > (lastcycle + cycledelay))
lastcycle = world.time
@@ -199,7 +199,7 @@
B.target_turf = get_turf(src)
B.strength -= 1
if(B.strength <= 0)
del(B)
qdel(B)
else if(B.strength <= 5)
B.icon_state = "bees[B.strength]"
bees_in_hive = 0
+6 -6
View File
@@ -44,27 +44,27 @@
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/remove_dead()
..()
del(src)
qdel(src)
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/harvest()
..()
if(!seed) // Repeat harvests are a thing.
del(src)
qdel(src)
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/die()
del(src)
qdel(src)
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/process()
if(!seed)
del(src)
qdel(src)
return
else if(name=="plant")
name = seed.display_name
..()
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/Del()
/obj/machinery/portable_atmospherics/hydroponics/soil/invisible/Destroy()
// Check if we're masking a decal that needs to be visible again.
for(var/obj/effect/plant/plant in get_turf(src))
if(plant.invisibility == INVISIBILITY_MAXIMUM)
plant.invisibility = initial(plant.invisibility)
..()
return ..()