From abca80b8d8e898b44cbfd41aec983413f023a6f4 Mon Sep 17 00:00:00 2001 From: Kyep Date: Tue, 20 Oct 2020 13:44:06 -0700 Subject: [PATCH 1/3] Fixes aghost gateway lockout --- code/_onclick/observer.dm | 4 ++++ code/modules/awaymissions/gateway.dm | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index 3452400edbb..5c301057525 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -86,11 +86,15 @@ /obj/machinery/gateway/centerstation/attack_ghost(mob/user as mob) if(awaygate) user.forceMove(awaygate.loc) + else if(user.can_admin_interact()) + attack_hand(user) else to_chat(user, "[src] has no destination.") /obj/machinery/gateway/centeraway/attack_ghost(mob/user as mob) if(stationgate) user.forceMove(stationgate.loc) + else if(user.can_admin_interact()) + attack_hand(user) else to_chat(user, "[src] has no destination.") diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index 0118b0febb4..cc9f3b6dfbd 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -107,7 +107,7 @@ GLOBAL_DATUM_INIT(the_gateway, /obj/machinery/gateway/centerstation, null) if(!awaygate) to_chat(user, "Error: No destination found.") return - if(world.time < wait) + if(world.time < wait && !user.can_admin_interact()) to_chat(user, "Error: Warpspace triangulation in progress. Estimated time to completion: [round(((wait - world.time) / 10) / 60)] minutes.") return From e2a5c32bfaa985501842242acfde675c648d540a Mon Sep 17 00:00:00 2001 From: Kyep Date: Tue, 20 Oct 2020 14:04:14 -0700 Subject: [PATCH 2/3] Better solution: let all ghosts transit the gate if off --- code/_onclick/observer.dm | 24 ++++++++++++------------ code/modules/awaymissions/gateway.dm | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index 5c301057525..b5a74240a31 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -84,17 +84,17 @@ user.forceMove(get_turf(target)) /obj/machinery/gateway/centerstation/attack_ghost(mob/user as mob) - if(awaygate) - user.forceMove(awaygate.loc) - else if(user.can_admin_interact()) - attack_hand(user) - else - to_chat(user, "[src] has no destination.") + if(!awaygate) + awaygate = locate(/obj/machinery/gateway/centeraway) in GLOB.machines + if(!awaygate) + to_chat(user, "Error: No destination found.") + return + user.forceMove(awaygate.loc) /obj/machinery/gateway/centeraway/attack_ghost(mob/user as mob) - if(stationgate) - user.forceMove(stationgate.loc) - else if(user.can_admin_interact()) - attack_hand(user) - else - to_chat(user, "[src] has no destination.") + if(!stationgate) + stationgate = locate(/obj/machinery/gateway/centerstation) in GLOB.machines + if(!stationgate) + to_chat(user, "Error: No destination found.") + return + user.forceMove(stationgate.loc) diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index cc9f3b6dfbd..0118b0febb4 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -107,7 +107,7 @@ GLOBAL_DATUM_INIT(the_gateway, /obj/machinery/gateway/centerstation, null) if(!awaygate) to_chat(user, "Error: No destination found.") return - if(world.time < wait && !user.can_admin_interact()) + if(world.time < wait) to_chat(user, "Error: Warpspace triangulation in progress. Estimated time to completion: [round(((wait - world.time) / 10) / 60)] minutes.") return From 9cc24b1ce462183e2eff4dd6fd31aa86e94a5545 Mon Sep 17 00:00:00 2001 From: Kyep Date: Tue, 20 Oct 2020 14:28:14 -0700 Subject: [PATCH 3/3] LateInitialize() fix --- code/_onclick/observer.dm | 20 ++++++++------------ code/controllers/configuration.dm | 2 +- code/modules/awaymissions/gateway.dm | 5 ++++- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index b5a74240a31..3452400edbb 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -84,17 +84,13 @@ user.forceMove(get_turf(target)) /obj/machinery/gateway/centerstation/attack_ghost(mob/user as mob) - if(!awaygate) - awaygate = locate(/obj/machinery/gateway/centeraway) in GLOB.machines - if(!awaygate) - to_chat(user, "Error: No destination found.") - return - user.forceMove(awaygate.loc) + if(awaygate) + user.forceMove(awaygate.loc) + else + to_chat(user, "[src] has no destination.") /obj/machinery/gateway/centeraway/attack_ghost(mob/user as mob) - if(!stationgate) - stationgate = locate(/obj/machinery/gateway/centerstation) in GLOB.machines - if(!stationgate) - to_chat(user, "Error: No destination found.") - return - user.forceMove(stationgate.loc) + if(stationgate) + user.forceMove(stationgate.loc) + else + to_chat(user, "[src] has no destination.") diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 756ce6f8527..a78288116ce 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -159,7 +159,7 @@ var/simultaneous_pm_warning_timeout = 100 var/assistant_maint = 0 //Do assistants get maint access? - var/gateway_delay = 6000 //How long the gateway takes before it activates. Default is half an hour. + var/gateway_delay = 6000 var/ghost_interaction = 0 var/comms_password = "" diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm index 0118b0febb4..19cefa36fa5 100644 --- a/code/modules/awaymissions/gateway.dm +++ b/code/modules/awaymissions/gateway.dm @@ -47,7 +47,10 @@ GLOBAL_DATUM_INIT(the_gateway, /obj/machinery/gateway/centerstation, null) /obj/machinery/gateway/centerstation/Initialize() ..() update_icon() - wait = world.time + config.gateway_delay //+ thirty minutes default + wait = world.time + config.gateway_delay + return INITIALIZE_HINT_LATELOAD + +/obj/machinery/gateway/centerstation/LateInitialize() awaygate = locate(/obj/machinery/gateway/centeraway) in GLOB.machines /obj/machinery/gateway/centerstation/update_density_from_dir()