diff --git a/code/modules/spacepods/spacepod.dm b/code/modules/spacepods/spacepod.dm
index 512a8ff0d38..36e9305258a 100644
--- a/code/modules/spacepods/spacepod.dm
+++ b/code/modules/spacepods/spacepod.dm
@@ -48,7 +48,7 @@
"pod_black" = "#3B8FE5", \
"pod_industrial" = "#CCCC00")
- var/allow2enter = 1
+ var/unlocked = 1
var/move_delay = 2
var/next_move = 0
@@ -238,7 +238,7 @@
/obj/spacepod/attackby(obj/item/W as obj, mob/user as mob, params)
if(iscrowbar(W))
- if(!equipment_system.lock_system || allow2enter || hatch_open)
+ if(!equipment_system.lock_system || unlocked || hatch_open)
hatch_open = !hatch_open
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1)
to_chat(user, "You [hatch_open ? "open" : "close"] the maintenance hatch.")
@@ -475,6 +475,7 @@
set src = usr.loc
set popup_menu = 0
if(usr != src.occupants[PILOT])
+ to_chat(usr, "You can't put a corpse into the driver's seat!")
return 0
@@ -565,7 +566,7 @@
*/
if(M == user)
- if(!equipment_system.lock_system || allow2enter)
+ if(!equipment_system.lock_system || unlocked)
enter_pod(user)
else
to_chat(user, "\The [src]'s doors are locked!")
@@ -647,7 +648,9 @@
/obj/spacepod/proc/occupant_sanity_check() // going to have to adjust this later for cargo refactor
if(occupants)
if(occupants.len == max_occupants && !occupants[PILOT])
- occupants[PILOT] = occupants[1]
+ var/occ = occupants[1]
+ occupants -= occ
+ occupants[PILOT] = occ
log_debug("##SPACEPOD WARNING: IMPOSSIBLE SEATING ARRANGEMENT: OCCUPANTS [english_list(occupants)], TURF [get_turf(src)] | AREA [get_area(src)] | COORDS [x], [y], [z]")
if(occupants.len > max_occupants)
for(var/i = occupants.len; i <= max_occupants; i--)
@@ -673,21 +676,31 @@
if(!istype(user))
return
+ if (usr.stat != CONSCIOUS) // unconscious people can't let themselves out
+ return
+
occupant_sanity_check()
- for(var/mob/M in occupants)
- if(M == user)
- M.forceMove(src.loc)
- occupants -= M
- to_chat(user, "You climb out of \the [src].")
+ if(user in occupants)
+ user.forceMove(get_turf(src))
+ occupants -= user
+ to_chat(user, "You climb out of \the [src].")
+ if(user == occupants[PILOT])
+ user.forceMove(get_turf(src))
+ occupants[PILOT] = null
+ to_chat(user, "You climb out of \the [src].")
/obj/spacepod/verb/lock_pod()
set name = "Lock Doors"
set category = "Spacepod"
set src = usr.loc
- allow2enter = !allow2enter
- to_chat(usr, "You [allow2enter ? "unlock" : "lock"] the doors.")
+ if(usr in occupants && usr != src.occupants[PILOT])
+ to_chat(usr, "You [unlocked ? "unlock" : "lock"] the doors.")
/obj/spacepod/verb/toggleDoors()
@@ -695,6 +708,10 @@
set category = "Spacepod"
set src = usr.loc
+ if(usr != src.occupants[PILOT])
+ to_chat(usr, "\The [src] has no weapons!")
return
@@ -726,6 +746,9 @@
set desc = "Unloads the cargo"
set category = "Spacepod"
set src = usr.loc
+ if(usr != src.occupants[PILOT])
+ to_chat(usr, "\The [src] has no cargo system!")
return
@@ -735,6 +758,9 @@
set name = "Toggle Lights"
set category = "Spacepod"
set src = usr.loc
+ if(usr != src.occupants[PILOT])
+ to_chat(usr, "