From 85e7823cffa261fa7c83fff6af34b6cb4591651c Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Sun, 17 Dec 2023 01:48:49 +0100 Subject: [PATCH 1/4] allows pulling of whitelisted items through redgate --- code/modules/awaymissions/redgate.dm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/code/modules/awaymissions/redgate.dm b/code/modules/awaymissions/redgate.dm index ab707f52f9..a1e2bdb0ba 100644 --- a/code/modules/awaymissions/redgate.dm +++ b/code/modules/awaymissions/redgate.dm @@ -53,9 +53,19 @@ var/turf/ourturf = find_our_turf(M) //Find the turf on the opposite side of the target if(!ourturf.check_density(TRUE,TRUE)) //Make sure there isn't a wall there M.unbuckle_all_mobs(TRUE) - M.stop_pulling() - playsound(src,'sound/effects/ominous-hum-2.ogg', 100,1) - M.forceMove(ourturf) //Let's just do forcemove, I don't really want people teleporting to weird places if they have bluespace stuff + if(M.pulling) + var/atom/movable/pulled = M.pulling + M.stop_pulling() + playsound(src,'sound/effects/ominous-hum-2.ogg', 100,1) + M.forceMove(ourturf) + if(pulled.type in exceptions) + pulled.forceMove(ourturf) + M.continue_pulling(pulled) + else + to_chat(M, "The redgate refused your pulled item.") + else + playsound(src,'sound/effects/ominous-hum-2.ogg', 100,1) + M.forceMove(ourturf) //Let's just do forcemove, I don't really want people teleporting to weird places if they have bluespace stuff else to_chat(M, "Something blocks your way.") @@ -1414,4 +1424,4 @@ else //todo; throw the ball in a random direction src.visible_message("\The [ball] bounces off \the [src]'s rim!") - global_announcer.autosay("[ball.last_holder] threw the HYPERball and +missed!+ |Oooh!|","Laserdome Announcer","Entertainment") \ No newline at end of file + global_announcer.autosay("[ball.last_holder] threw the HYPERball and +missed!+ |Oooh!|","Laserdome Announcer","Entertainment") From c6f211e0c6e58b4ed9ad8e5fa15bf2eb8f83b99d Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Sun, 17 Dec 2023 07:47:21 +0100 Subject: [PATCH 2/4] ensure the blacklisted items are not on the pulled bed by kicking them --- code/modules/awaymissions/redgate.dm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/modules/awaymissions/redgate.dm b/code/modules/awaymissions/redgate.dm index a1e2bdb0ba..243c56c361 100644 --- a/code/modules/awaymissions/redgate.dm +++ b/code/modules/awaymissions/redgate.dm @@ -11,7 +11,9 @@ var/obj/structure/redgate/target var/secret = FALSE //If either end of the redgate has this enabled, ghosts will not be able to click to teleport var/list/exceptions = list( - /obj/structure/ore_box + /obj/structure/ore_box, + /obj/structure/bed/roller, + /obj/structure/bed/roller/adv ) //made it a var so that GMs or map makers can selectively allow things to pass through var/list/restrictions = list( /mob/living/simple_mob/vore/overmap/stardog, @@ -59,6 +61,11 @@ playsound(src,'sound/effects/ominous-hum-2.ogg', 100,1) M.forceMove(ourturf) if(pulled.type in exceptions) + if(istype(pulled,/obj/structure/bed/roller)) + var/obj/structure/bed/roller/R = pulled + for(var/mob/on_roller in R.buckled_mobs) + if(!on_roller.key || (on_roller.type in restrictions)) + R.unbuckle_mob(on_roller, TRUE) pulled.forceMove(ourturf) M.continue_pulling(pulled) else From 250f02c9b77202a5fea6158927b9145f087f4988 Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Sun, 17 Dec 2023 23:05:32 +0100 Subject: [PATCH 3/4] generalized --- code/modules/awaymissions/redgate.dm | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/code/modules/awaymissions/redgate.dm b/code/modules/awaymissions/redgate.dm index 243c56c361..050f638d6d 100644 --- a/code/modules/awaymissions/redgate.dm +++ b/code/modules/awaymissions/redgate.dm @@ -12,8 +12,7 @@ var/secret = FALSE //If either end of the redgate has this enabled, ghosts will not be able to click to teleport var/list/exceptions = list( /obj/structure/ore_box, - /obj/structure/bed/roller, - /obj/structure/bed/roller/adv + /obj/structure/bed/roller ) //made it a var so that GMs or map makers can selectively allow things to pass through var/list/restrictions = list( /mob/living/simple_mob/vore/overmap/stardog, @@ -32,7 +31,7 @@ /obj/structure/redgate/proc/teleport(var/mob/M as mob) var/keycheck = TRUE if (!istype(M,/mob/living)) //We only want mob/living, no bullets or mechs or AI eyes or items - if(M.type in exceptions) + if(is_type_in_list(M, exceptions)) keycheck = FALSE //we'll allow it else return @@ -55,17 +54,15 @@ var/turf/ourturf = find_our_turf(M) //Find the turf on the opposite side of the target if(!ourturf.check_density(TRUE,TRUE)) //Make sure there isn't a wall there M.unbuckle_all_mobs(TRUE) - if(M.pulling) + if(istype(M,/mob/living) && M.pulling) var/atom/movable/pulled = M.pulling M.stop_pulling() playsound(src,'sound/effects/ominous-hum-2.ogg', 100,1) M.forceMove(ourturf) - if(pulled.type in exceptions) - if(istype(pulled,/obj/structure/bed/roller)) - var/obj/structure/bed/roller/R = pulled - for(var/mob/on_roller in R.buckled_mobs) - if(!on_roller.key || (on_roller.type in restrictions)) - R.unbuckle_mob(on_roller, TRUE) + if(is_type_in_list(pulled, exceptions)) + for(var/mob/living/buckled_on in pulled.buckled_mobs) + if(!buckled_on.key || (buckled_on.type in restrictions)) + pulled.unbuckle_mob(buckled_on, TRUE) pulled.forceMove(ourturf) M.continue_pulling(pulled) else From 58ac42145ae8a855b87746e29bb3bf6a4ec49134 Mon Sep 17 00:00:00 2001 From: Kashargul <144968721+Kashargul@users.noreply.github.com> Date: Mon, 18 Dec 2023 05:20:29 +0100 Subject: [PATCH 4/4] generalized the blaclists, too --- code/modules/awaymissions/redgate.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/awaymissions/redgate.dm b/code/modules/awaymissions/redgate.dm index 050f638d6d..c2de8cf370 100644 --- a/code/modules/awaymissions/redgate.dm +++ b/code/modules/awaymissions/redgate.dm @@ -36,7 +36,7 @@ else return - if(M.type in restrictions) //Some stuff we don't want to bring EVEN IF it has a key. + if(is_type_in_list(M, restrictions)) //Some stuff we don't want to bring EVEN IF it has a key. return for(var/obj/O in M.contents) @@ -61,7 +61,7 @@ M.forceMove(ourturf) if(is_type_in_list(pulled, exceptions)) for(var/mob/living/buckled_on in pulled.buckled_mobs) - if(!buckled_on.key || (buckled_on.type in restrictions)) + if(!buckled_on.key || is_type_in_list(M, restrictions)) pulled.unbuckle_mob(buckled_on, TRUE) pulled.forceMove(ourturf) M.continue_pulling(pulled)