Hydro and Bees GC fixes (#7221)

* Hydro and Bees GC fixes

* more shit
This commit is contained in:
Fox McCloud
2017-05-06 15:01:36 -07:00
committed by Crazy Lemon
parent 9509cf7311
commit 12c4b2933c
10 changed files with 201 additions and 139 deletions
@@ -51,11 +51,13 @@
/obj/structure/beebox/Destroy()
processing_objects.Remove(src)
for(var/mob/living/simple_animal/hostile/poison/bees/B in bees)
B.beehome = null
bees.Cut()
bees = null
honeycombs.Cut()
honeycombs = null
queen_bee = null
QDEL_LIST(honeycombs)
QDEL_LIST(honey_frames)
QDEL_NULL(queen_bee)
return ..()
+1
View File
@@ -75,6 +75,7 @@
plant_hud_set_water()
/obj/machinery/hydroponics/Destroy()
remove_from_all_data_huds()
QDEL_NULL(myseed)
return ..()
+7 -3
View File
@@ -44,7 +44,7 @@
icon_state = "sextractor"
density = 1
anchored = 1
var/piles = list()
var/list/piles = list()
var/max_seeds = 1000
var/seed_multiplier = 1
@@ -56,6 +56,10 @@
component_parts += new /obj/item/weapon/stock_parts/manipulator(null)
RefreshParts()
/obj/machinery/seed_extractor/Destroy()
QDEL_LIST(piles)
return ..()
/obj/machinery/seed_extractor/RefreshParts()
for(var/obj/item/weapon/stock_parts/matter_bin/B in component_parts)
max_seeds = 1000 * B.rating
@@ -125,14 +129,14 @@
/obj/machinery/seed_extractor/attack_hand(mob/user)
interact(user)
/obj/machinery/seed_extractor/attack_ghost(mob/user)
interact(user)
/obj/machinery/seed_extractor/interact(mob/user)
if(stat)
return 0
add_fingerprint(user)
user.set_machine(src)
+1 -3
View File
@@ -69,9 +69,7 @@
genes += new /datum/plant_gene/reagent(reag_id, reagents_add[reag_id])
/obj/item/seeds/Destroy()
for(var/thing in genes)
qdel(thing)
genes.Cut()
QDEL_LIST(genes)
return ..()
/obj/item/seeds/proc/Copy()
+49 -11
View File
@@ -41,6 +41,7 @@ var/list/robot_verbs_default = list(
// Components are basically robot organs.
var/list/components = list()
var/obj/item/robot_parts/robot_suit/robot_suit = null //Used for deconstruction to remember what the borg was constructed out of..
var/obj/item/device/mmi/mmi = null
var/obj/item/device/pda/silicon/robot/rbPDA = null
@@ -255,6 +256,7 @@ var/list/robot_verbs_default = list(
QDEL_NULL(module)
QDEL_NULL(camera)
QDEL_NULL(cell)
QDEL_NULL(robot_suit)
return ..()
/mob/living/silicon/robot/proc/pick_module()
@@ -644,20 +646,13 @@ var/list/robot_verbs_default = list(
else if(wiresexposed && wires.IsAllCut())
//Cell is out, wires are exposed, remove MMI, produce damaged chassis, baleet original mob.
if(!mmi)
to_chat(user, "\The [src] has no brain to remove.")
to_chat(user, "[src] has no brain to remove.")
return
to_chat(user, "You jam the crowbar into the robot and begin levering [mmi].")
to_chat(user, "You jam the crowbar into the robot and begin levering the securing bolts.")
if(do_after(user, 30 * W.toolspeed, target = src))
to_chat(user, "You damage some parts of the chassis, but eventually manage to rip out [mmi]!")
var/obj/item/robot_parts/robot_suit/C = new/obj/item/robot_parts/robot_suit(loc)
C.l_leg = new/obj/item/robot_parts/l_leg(C)
C.r_leg = new/obj/item/robot_parts/r_leg(C)
C.l_arm = new/obj/item/robot_parts/l_arm(C)
C.r_arm = new/obj/item/robot_parts/r_arm(C)
C.updateicon()
new/obj/item/robot_parts/chest(loc)
qdel(src)
user.visible_message("[user] deconstructs [src]!", "<span class='notice'>You unfasten the securing bolts, and [src] falls to pieces!</span>")
deconstruct()
else
// Okay we're not removing the cell or an MMI, but maybe something else?
var/list/removable_components = list()
@@ -1135,6 +1130,49 @@ var/list/robot_verbs_default = list(
update_icons()
/mob/living/silicon/robot/proc/deconstruct()
var/turf/T = get_turf(src)
if(robot_suit)
robot_suit.forceMove(T)
robot_suit.l_leg.forceMove(T)
robot_suit.l_leg = null
robot_suit.r_leg.forceMove(T)
robot_suit.r_leg = null
new /obj/item/stack/cable_coil(T, robot_suit.chest.wired)
robot_suit.chest.forceMove(T)
robot_suit.chest.wired = FALSE
robot_suit.chest = null
robot_suit.l_arm.forceMove(T)
robot_suit.l_arm = null
robot_suit.r_arm.forceMove(T)
robot_suit.r_arm = null
robot_suit.head.forceMove(T)
robot_suit.head.flash1.forceMove(T)
robot_suit.head.flash1.burn_out()
robot_suit.head.flash1 = null
robot_suit.head.flash2.forceMove(T)
robot_suit.head.flash2.burn_out()
robot_suit.head.flash2 = null
robot_suit.head = null
robot_suit.updateicon()
else
new /obj/item/robot_parts/robot_suit(T)
new /obj/item/robot_parts/l_leg(T)
new /obj/item/robot_parts/r_leg(T)
new /obj/item/stack/cable_coil(T, 1)
new /obj/item/robot_parts/chest(T)
new /obj/item/robot_parts/l_arm(T)
new /obj/item/robot_parts/r_arm(T)
new /obj/item/robot_parts/head(T)
var/b
for(b=0, b!=2, b++)
var/obj/item/device/flash/F = new /obj/item/device/flash(T)
F.burn_out()
if(cell) //Sanity check.
cell.forceMove(T)
cell = null
qdel(src)
#define BORG_CAMERA_BUFFER 30
/mob/living/silicon/robot/Move(a, b, flag)
var/oldLoc = src.loc
@@ -58,15 +58,12 @@
/mob/living/simple_animal/hostile/poison/bees/Destroy()
beegent = null
if(beehome)
if(beehome.bees)
beehome.bees.Remove(src)
beehome = null
return ..()
/mob/living/simple_animal/hostile/poison/bees/death(gibbed)
beegent = null
..()
/mob/living/simple_animal/hostile/poison/bees/examine(mob/user)
..()
/mob/living/simple_animal/hostile/poison/bees/proc/generate_bee_visuals()
overlays.Cut()
@@ -137,21 +134,6 @@
/mob/living/simple_animal/hostile/poison/bees/worker
//Blank type define in case we need to give them special stuff later, plus organization (currently they are same as base type bee)
/mob/living/simple_animal/hostile/poison/bees/worker/Destroy()
if(beehome)
if(beehome.bees)
beehome.bees.Remove(src)
beehome = null
return ..()
/mob/living/simple_animal/hostile/poison/bees/worker/death(gibbed)
if(beehome)
if(beehome.bees)
beehome.bees.Remove(src)
beehome = null
..()
/mob/living/simple_animal/hostile/poison/bees/worker/examine(mob/user)
..()
@@ -313,6 +295,10 @@
beegent = new /datum/reagent/facid() //prepare to die
var/list/master_and_friends = list()
/mob/living/simple_animal/hostile/poison/bees/syndi/Destroy()
master_and_friends.Cut()
return ..()
/mob/living/simple_animal/hostile/poison/bees/syndi/assign_reagent(datum/reagent/R)
return
@@ -30,7 +30,7 @@
var/attack_same = 0 //Set us to 1 to allow us to attack our own faction, or 2, to only ever attack our own faction
var/AIStatus = AI_ON //The Status of our AI, can be set to AI_ON (On, usual processing), AI_IDLE (Will not process, but will return to AI_ON if an enemy comes near), AI_OFF (Off, Not processing ever)
//typecache of things this mob will attack in DestroySurroundings() if it has environment_smash
var/list/environment_target_typecache = list(
/obj/machinery/door/window,
@@ -44,15 +44,16 @@
var/atom/targets_from = null //all range/attack/etc. calculations should be done from this atom, defaults to the mob itself, useful for Vehicles and such
var/list/emote_taunt = list()
var/taunt_chance = 0
/mob/living/simple_animal/hostile/New()
..()
if(!targets_from)
targets_from = src
environment_target_typecache = typecacheof(environment_target_typecache)
/mob/living/simple_animal/hostile/Destroy()
targets_from = null
target = null
return ..()
/mob/living/simple_animal/hostile/Life()
@@ -80,7 +81,7 @@
if(AIShouldSleep(possible_targets)) // we try to acquire a new one
AIStatus = AI_IDLE // otherwise we go idle
return 1
/mob/living/simple_animal/hostile/attacked_by(obj/item/I, mob/living/user)
if(stat == CONSCIOUS && !target && AIStatus != AI_OFF && !client && user)
FindTarget(list(user), 1)
@@ -91,8 +92,8 @@
if(P.firer && get_dist(src, P.firer) <= aggro_vision_range)
FindTarget(list(P.firer), 1)
Goto(P.starting, move_to_delay, 3)
return ..()
return ..()
//////////////HOSTILE MOB TARGETTING AND AGGRESSION////////////
@@ -126,7 +127,7 @@
var/Target = PickTarget(.)
GiveTarget(Target)
return Target //We now have a target
/mob/living/simple_animal/hostile/proc/PossibleThreats()
. = list()
for(var/pos_targ in ListTargets())
@@ -176,24 +177,24 @@
if(faction_check && !attack_same)
return 0
return 1
if(ishuman(the_target))
var/mob/living/carbon/human/H = the_target
if(is_type_in_list(src, H.species.ignored_by))
return 0
if(istype(the_target, /obj/mecha))
var/obj/mecha/M = the_target
if(M.occupant)//Just so we don't attack empty mechs
if(CanAttack(M.occupant))
return 1
if(istype(the_target, /obj/spacepod))
var/obj/spacepod/S = the_target
if(S.pilot) //Just so we don't attack empty pods
if(CanAttack(S.pilot))
return 1
if(istype(the_target, /obj/machinery/porta_turret))
var/obj/machinery/porta_turret/P = the_target
if(P.faction in faction)
@@ -292,7 +293,7 @@
/mob/living/simple_animal/hostile/death(gibbed)
LoseTarget()
..(gibbed)
/mob/living/simple_animal/hostile/proc/summon_backup(distance)
do_alert_animation(src)
playsound(loc, 'sound/machines/chime.ogg', 50, 1, -1)