From 755b282b6d260f238c086c6190dc4063333a24ca Mon Sep 17 00:00:00 2001 From: FalseIncarnate Date: Mon, 26 Sep 2016 23:48:50 -0400 Subject: [PATCH 1/2] Arcade duplication fix Arcade machines should no longer spawn additional arcade machines after spawning additional arcade machines after spawning additional... --- code/modules/arcade/arcade_base.dm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/code/modules/arcade/arcade_base.dm b/code/modules/arcade/arcade_base.dm index d886fa3f4be..b40e935422a 100644 --- a/code/modules/arcade/arcade_base.dm +++ b/code/modules/arcade/arcade_base.dm @@ -12,13 +12,14 @@ var/freeplay = 0 //for debugging and admin kindness var/token_price = 0 var/last_winner = null //for letting people who to hunt down and steal prizes from - var/window_name = "arcade" //in case you want to change the window name for certain machines + var/window_name = "arcade" //the window name for arcade machines (also prevents New() from spawning a new machine, so make sure you change this for subtypes) /obj/machinery/arcade/New() ..() - var/choice = pick(subtypesof(/obj/machinery/arcade)) - new choice(loc) - qdel(src) + if(window_name == "arcade") //if the window_name is not changed, this will assume it is the base type and spawn a new subtype machine in its place. + var/choice = pick(subtypesof(/obj/machinery/arcade)) + new choice(loc) + qdel(src) /obj/machinery/arcade/examine(mob/user) ..(user) @@ -76,7 +77,7 @@ if(pay_with_cash(C, user)) tokens += 1 return - if(panel_open&& component_parts && istype(O, /obj/item/weapon/crowbar)) + if(panel_open && component_parts && istype(O, /obj/item/weapon/crowbar)) default_deconstruction_crowbar(O) /obj/machinery/arcade/update_icon() From 977950b1c22ecc63daef2476fcd954c0b414105b Mon Sep 17 00:00:00 2001 From: FalseIncarnate Date: Wed, 28 Sep 2016 18:57:43 -0400 Subject: [PATCH 2/2] type-check instead of variable check --- code/modules/arcade/arcade_base.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/arcade/arcade_base.dm b/code/modules/arcade/arcade_base.dm index b40e935422a..3c68c7142f4 100644 --- a/code/modules/arcade/arcade_base.dm +++ b/code/modules/arcade/arcade_base.dm @@ -12,11 +12,11 @@ var/freeplay = 0 //for debugging and admin kindness var/token_price = 0 var/last_winner = null //for letting people who to hunt down and steal prizes from - var/window_name = "arcade" //the window name for arcade machines (also prevents New() from spawning a new machine, so make sure you change this for subtypes) + var/window_name = "arcade" //in case you want to change the window name for certain machines /obj/machinery/arcade/New() ..() - if(window_name == "arcade") //if the window_name is not changed, this will assume it is the base type and spawn a new subtype machine in its place. + if(type == /obj/machinery/arcade) //if you spawn the base-type, it will replace itself with a random subtype for randomness var/choice = pick(subtypesof(/obj/machinery/arcade)) new choice(loc) qdel(src)