From 02c0430e9966dc3d1b29b4b344b0ed6dbf60b143 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Thu, 18 Jan 2018 14:27:23 -0500 Subject: [PATCH 1/5] POLARIS: Simplify Destroy on plane_master If we're being Destroyed, the mob probably is too. Their job to remove references to us though. --- code/modules/mob/mob_planes.dm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/modules/mob/mob_planes.dm b/code/modules/mob/mob_planes.dm index 3da38e9c36e..437d70914b7 100644 --- a/code/modules/mob/mob_planes.dm +++ b/code/modules/mob/mob_planes.dm @@ -36,9 +36,7 @@ ..() /datum/plane_holder/Destroy() - if(my_mob) - my_mob.plane_holder = null - my_mob = null + my_mob = null plane_masters.Cut() //Goodbye my children, be free return ..() From d6c42739f624e45af98f0502cccd502506b38924 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Thu, 18 Jan 2018 18:08:13 -0500 Subject: [PATCH 2/5] POLARIS: Remove the ability to powergame with tiny amounts of certain reactions --- code/modules/reagents/Chemistry-Recipes.dm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index f7fed5fa762..cb7d5c193b9 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -703,8 +703,9 @@ var/mob/living/L = holder.my_atom if(L.stat != DEAD) e.amount *= 0.5 + else + holder.clear_reagents() //No more powergaming by creating a tiny amount of this e.start() - holder.clear_reagents() return /datum/chemical_reaction/flash_powder @@ -749,7 +750,8 @@ // 100 created volume = 4 heavy range & 7 light range. A few tiles smaller than traitor EMP grandes. // 200 created volume = 8 heavy range & 14 light range. 4 tiles larger than traitor EMP grenades. empulse(location, round(created_volume / 24), round(created_volume / 20), round(created_volume / 18), round(created_volume / 14), 1) - holder.clear_reagents() + if(!isliving(holder.my_atom)) //No more powergaming by creating a tiny amount of this + holder.clear_reagents() return /datum/chemical_reaction/nitroglycerin @@ -768,9 +770,10 @@ var/mob/living/L = holder.my_atom if(L.stat!=DEAD) e.amount *= 0.5 + else + holder.clear_reagents() //No more powergaming by creating a tiny amount of this e.start() - holder.clear_reagents() return /datum/chemical_reaction/napalm @@ -803,7 +806,8 @@ playsound(location, 'sound/effects/smoke.ogg', 50, 1, -3) spawn(0) S.start() - holder.clear_reagents() + if(!isliving(holder.my_atom)) //No more powergaming by creating a tiny amount of this + holder.clear_reagents() return /datum/chemical_reaction/foam @@ -823,7 +827,8 @@ var/datum/effect/effect/system/foam_spread/s = new() s.set_up(created_volume, location, holder, 0) s.start() - holder.clear_reagents() + if(!isliving(holder.my_atom)) //No more powergaming by creating a tiny amount of this + holder.clear_reagents() return /datum/chemical_reaction/metalfoam From 4432b2dd8bdc95ae3613638f127efdd9d0918d8f Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Thu, 18 Jan 2018 14:53:27 -0500 Subject: [PATCH 3/5] VS: Adds Destroy on shock collars (tsk tsk) --- .../under/accessories/accessory_vr.dm | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/code/modules/clothing/under/accessories/accessory_vr.dm b/code/modules/clothing/under/accessories/accessory_vr.dm index 51c8c3279e1..4a975f6bf75 100644 --- a/code/modules/clothing/under/accessories/accessory_vr.dm +++ b/code/modules/clothing/under/accessories/accessory_vr.dm @@ -34,20 +34,25 @@ icon_state = "collar_shk0" item_state = "collar_shk_overlay" overlay_state = "collar_shk_overlay" - // How about some copypasta? - var/on = 0 // 0 for off, 1 for on, starts off to encourage people to set non-default frequencies and codes. + var/on = FALSE // 0 for off, 1 for on, starts off to encourage people to set non-default frequencies and codes. var/frequency = 1449 var/code = 2 var/datum/radio_frequency/radio_connection - var/list/datum/radio_frequency/secure_radio_connections = new - proc/set_frequency(new_frequency) - radio_controller.remove_object(src, frequency) - frequency = new_frequency - radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT) - + /obj/item/clothing/accessory/collar/shock/New() + ..() radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT) // Makes it so you don't need to change the frequency off of default for it to work. - + +/obj/item/clothing/accessory/collar/shock/Destroy() //Clean up your toys when you're done. + radio_controller.remove_object(src, frequency) + radio_connection = null //Don't delete this, this is a shared object. + return ..() + +/obj/item/clothing/accessory/collar/shock/proc/set_frequency(new_frequency) + radio_controller.remove_object(src, frequency) + frequency = new_frequency + radio_connection = radio_controller.add_object(src, frequency, RADIO_CHAT) + /obj/item/clothing/accessory/collar/shock/Topic(href, href_list) if(usr.stat || usr.restrained()) return @@ -107,24 +112,23 @@ return user.set_machine(src) var/dat = {" -Turn [on ? "Off" : "On"]
-Frequency/Code for collar:
-Frequency: -- -- [format_frequency(frequency)] -+ -+
+ Turn [on ? "Off" : "On"]
+ Frequency/Code for collar:
+ Frequency: + - + - [format_frequency(frequency)] + + + +
-Code: -- -- [code] -+ -+
-
"} + Code: + - + - [code] + + + +
+ "} user << browse(dat, "window=radio") onclose(user, "radio") return - /obj/item/clothing/accessory/collar/spike name = "Spiked collar" From 853c9699dd34c919581264d2a658432a1e345b84 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Thu, 18 Jan 2018 15:06:14 -0500 Subject: [PATCH 4/5] VS: Clean up NIFs in human destroy in particular --- code/modules/mob/living/carbon/human/human.dm | 2 +- code/modules/nifsoft/nif.dm | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 449b2e9e1aa..dfade3414b9 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -63,7 +63,7 @@ list_body = null LAZYCLEARLIST(list_huds) list_huds = null - + if(nif) qdel_null(nif) //VOREStation Add return ..() /mob/living/carbon/human/Stat() diff --git a/code/modules/nifsoft/nif.dm b/code/modules/nifsoft/nif.dm index 261b058aa94..2d77c62eb4a 100644 --- a/code/modules/nifsoft/nif.dm +++ b/code/modules/nifsoft/nif.dm @@ -95,9 +95,7 @@ You can also set the stat of a NIF to NIF_TEMPFAIL without any issues to disable //Destructor cleans up references /obj/item/device/nif/Destroy() - if(human) - human.nif = null - human = null + human = null qdel_null_list(nifsofts) qdel_null(comm) nifsofts_life.Cut() From ade70895c0f386ac5f3e87da26a4c0c316275e87 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Thu, 18 Jan 2018 18:28:10 -0500 Subject: [PATCH 5/5] POLARIS: What if I want to wear a mouse on my head --- code/modules/mob/living/carbon/human/human_helpers.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 50059f47b26..4cf0be2dc5b 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -135,7 +135,7 @@ for(var/slot in slots) var/obj/item/clothing/O = get_equipped_item(slot) //Change this type if you move the vision stuff to item or something. - if(O && O.enables_planes && (slot in O.plane_slots)) + if(istype(O) && O.enables_planes && (slot in O.plane_slots)) compiled_vis |= O.enables_planes //Check to see if we have a rig (ugh, blame rigs, desnowflake this)