From cd24e9feff00984970bf8bf4551cdc5990fea0b8 Mon Sep 17 00:00:00 2001 From: Austin Rickli Date: Thu, 25 Apr 2019 09:45:20 -0700 Subject: [PATCH] Fixes Hilbert's Hotel from being able to enter itself. (#43602) * Prevented Hilbert's Hotel from being able to enter one of it's own rooms. * Because apparently "niche features" are required... * Apparently this is better? * A Final Compromise... * Return of the Parenthesis --- .../ruins/spaceruin_code/hilbertshotel.dm | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/code/modules/ruins/spaceruin_code/hilbertshotel.dm b/code/modules/ruins/spaceruin_code/hilbertshotel.dm index 2a9a97b951d..8ab5d68ff2d 100644 --- a/code/modules/ruins/spaceruin_code/hilbertshotel.dm +++ b/code/modules/ruins/spaceruin_code/hilbertshotel.dm @@ -319,6 +319,33 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) var/datum/turf_reservation/reservation var/turf/storageTurf +/area/hilbertshotel/Entered(atom/movable/AM) + . = ..() + if(istype(AM, /obj/item/hilbertshotel)) + relocate(AM) + var/list/obj/item/hilbertshotel/hotels = AM.GetAllContents(/obj/item/hilbertshotel) + for(var/obj/item/hilbertshotel/H in hotels) + if(parentSphere == H) + relocate(H) + +/area/hilbertshotel/proc/relocate(obj/item/hilbertshotel/H) + if(prob(0.135685)) //Because screw you + qdel(H) + return + var/turf/targetturf = find_safe_turf() + if(!targetturf) + if(GLOB.blobstart.len > 0) + targetturf = get_turf(pick(GLOB.blobstart)) + else + CRASH("Unable to find a blobstart landmark") + var/turf/T = get_turf(H) + var/area/A = T.loc + log_game("[H] entered itself. Moving it to [loc_name(targetturf)].") + message_admins("[H] entered itself. Moving it to [ADMIN_VERBOSEJMP(targetturf)].") + for(var/mob/M in A) + to_chat(M, "[H] almost implodes in upon itself, but quickly rebounds, shooting off into a random point in space!") + H.forceMove(targetturf) + /area/hilbertshotel/Exited(atom/movable/AM) . = ..() if(ismob(AM))