From 5ce80078ab1c7c886ba2f0cbbac8d995fcbc1c6a Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Thu, 23 Jan 2020 19:03:26 -0700 Subject: [PATCH 1/4] Update hilbertshotel.dm --- code/modules/ruins/spaceruin_code/hilbertshotel.dm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/modules/ruins/spaceruin_code/hilbertshotel.dm b/code/modules/ruins/spaceruin_code/hilbertshotel.dm index dc721506a5..e600f6c2c7 100644 --- a/code/modules/ruins/spaceruin_code/hilbertshotel.dm +++ b/code/modules/ruins/spaceruin_code/hilbertshotel.dm @@ -12,6 +12,7 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) var/datum/map_template/hilbertshotel/lore/hotelRoomTempLore var/list/activeRooms = list() var/list/storedRooms = list() + var/list/checked_in_ckeys = list() var/storageTurf //Lore Stuff var/ruinSpawned = FALSE @@ -44,7 +45,7 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) /obj/item/hilbertshotel/proc/promptAndCheckIn(mob/user) var/chosenRoomNumber = input(user, "What number room will you be checking into?", "Room Number") as null|num - if(!chosenRoomNumber) + if(!chosenRoomNumber || !user.CanReach(src)) return if(chosenRoomNumber > SHORT_REAL_LIMIT) to_chat(user, "You have to check out the first [SHORT_REAL_LIMIT] rooms before you can go to a higher numbered one!") @@ -52,8 +53,8 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) if((chosenRoomNumber < 1) || (chosenRoomNumber != round(chosenRoomNumber))) to_chat(user, "That is not a valid room number!") return - if(ismob(loc)) - if(user == loc) //Not always the same as user + if(!isturf(loc)) + if((loc == user) || (loc.loc == user) || (loc in user.GetAllContents(type)) //short circuit, first two checks are cheaper. forceMove(get_turf(user)) if(!storageTurf) //Blame subsystems for not allowing this to be in Initialize if(!GLOB.hhStorageTurf) @@ -63,13 +64,13 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) GLOB.hhStorageTurf = locate(storageReservation.bottom_left_coords[1]+1, storageReservation.bottom_left_coords[2]+1, storageReservation.bottom_left_coords[3]) else storageTurf = GLOB.hhStorageTurf + checked_in_ckeys |= user.ckey //if anything below runtimes, guess you're outta luck! if(tryActiveRoom(chosenRoomNumber, user)) return if(tryStoredRoom(chosenRoomNumber, user)) return sendToNewRoom(chosenRoomNumber, user) - /obj/item/hilbertshotel/proc/tryActiveRoom(var/roomNumber, var/mob/user) if(activeRooms["[roomNumber]"]) var/datum/turf_reservation/roomReservation = activeRooms["[roomNumber]"] @@ -102,6 +103,7 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) else return FALSE +/// This is a BLOCKING OPERATION. Note the room load call, and the block reservation calls. /obj/item/hilbertshotel/proc/sendToNewRoom(var/roomNumber, var/mob/user) var/datum/turf_reservation/roomReservation = SSmapping.RequestBlockReservation(hotelRoomTemp.width, hotelRoomTemp.height) if(ruinSpawned) @@ -200,7 +202,6 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) name = "Hilbert's Hotel Storage" mappath = '_maps/templates/hilbertshotelstorage.dmm' - //Turfs and Areas /turf/closed/indestructible/hotelwall name = "hotel wall" @@ -359,6 +360,7 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) . = ..() if(ismob(AM)) var/mob/M = AM + parentSphere?.checked_in_ckeys -= M.ckey if(M.mind) var/stillPopulated = FALSE var/list/currentLivingMobs = GetAllContents(/mob/living) //Got to catch anyone hiding in anything From 65871ca1d3d37bc13f6b17f5bcbd16d185c8532a Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Thu, 23 Jan 2020 19:07:17 -0700 Subject: [PATCH 2/4] Update hilbertshotel.dm --- code/modules/ruins/spaceruin_code/hilbertshotel.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/ruins/spaceruin_code/hilbertshotel.dm b/code/modules/ruins/spaceruin_code/hilbertshotel.dm index e600f6c2c7..dfd5db3d65 100644 --- a/code/modules/ruins/spaceruin_code/hilbertshotel.dm +++ b/code/modules/ruins/spaceruin_code/hilbertshotel.dm @@ -54,7 +54,7 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) to_chat(user, "That is not a valid room number!") return if(!isturf(loc)) - if((loc == user) || (loc.loc == user) || (loc in user.GetAllContents(type)) //short circuit, first two checks are cheaper. + if((loc == user) || (loc.loc == user) || (loc.loc in user.contents) || (loc in user.GetAllContents(type)) //short circuit, first two checks are cheaper and covers almost all case (loc.loc covers hotel in box in backpack). forceMove(get_turf(user)) if(!storageTurf) //Blame subsystems for not allowing this to be in Initialize if(!GLOB.hhStorageTurf) From 99d6d589ac65e5ef927a8c734b2b881ec27bebb0 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Thu, 23 Jan 2020 19:07:39 -0700 Subject: [PATCH 3/4] Update hilbertshotel.dm --- code/modules/ruins/spaceruin_code/hilbertshotel.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/ruins/spaceruin_code/hilbertshotel.dm b/code/modules/ruins/spaceruin_code/hilbertshotel.dm index dfd5db3d65..b34bea3179 100644 --- a/code/modules/ruins/spaceruin_code/hilbertshotel.dm +++ b/code/modules/ruins/spaceruin_code/hilbertshotel.dm @@ -54,7 +54,7 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) to_chat(user, "That is not a valid room number!") return if(!isturf(loc)) - if((loc == user) || (loc.loc == user) || (loc.loc in user.contents) || (loc in user.GetAllContents(type)) //short circuit, first two checks are cheaper and covers almost all case (loc.loc covers hotel in box in backpack). + if((loc == user) || (loc.loc == user) || (loc.loc in user.contents) || (loc in user.GetAllContents(type)) //short circuit, first three checks are cheaper and covers almost all cases (loc.loc covers hotel in box in backpack). forceMove(get_turf(user)) if(!storageTurf) //Blame subsystems for not allowing this to be in Initialize if(!GLOB.hhStorageTurf) From a5ddd4efa9270ee87f13fc3cb439bdafcedba987 Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Fri, 24 Jan 2020 00:01:02 -0700 Subject: [PATCH 4/4] Update hilbertshotel.dm --- code/modules/ruins/spaceruin_code/hilbertshotel.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/ruins/spaceruin_code/hilbertshotel.dm b/code/modules/ruins/spaceruin_code/hilbertshotel.dm index b34bea3179..8648e46cb9 100644 --- a/code/modules/ruins/spaceruin_code/hilbertshotel.dm +++ b/code/modules/ruins/spaceruin_code/hilbertshotel.dm @@ -54,7 +54,7 @@ GLOBAL_VAR_INIT(hhmysteryRoomNumber, 1337) to_chat(user, "That is not a valid room number!") return if(!isturf(loc)) - if((loc == user) || (loc.loc == user) || (loc.loc in user.contents) || (loc in user.GetAllContents(type)) //short circuit, first three checks are cheaper and covers almost all cases (loc.loc covers hotel in box in backpack). + if((loc == user) || (loc.loc == user) || (loc.loc in user.contents) || (loc in user.GetAllContents(type))) //short circuit, first three checks are cheaper and covers almost all cases (loc.loc covers hotel in box in backpack). forceMove(get_turf(user)) if(!storageTurf) //Blame subsystems for not allowing this to be in Initialize if(!GLOB.hhStorageTurf)