Fixes pod lock buster and locking without locks

Ensures pods are only locked when there is a pod lock, and let's pod
lock busters unlock the pod, and not jusre destroy a lock. Also minor
typo correction and replacing a 1 used as boolean with TRUE
This commit is contained in:
Mars
2018-01-23 20:01:37 +01:00
parent bf89cffbb3
commit 66838caa8b
+13 -4
View File
@@ -63,7 +63,7 @@
"pod_black" = "#3B8FE5", \
"pod_industrial" = "#CCCC00")
var/unlocked = 1
var/unlocked = TRUE
var/move_delay = 2
var/next_move = 0
@@ -378,12 +378,17 @@
"<span class='notice'>You start drilling through the [src]'s lock!</span>")
if(do_after(user, 100 * W.toolspeed, target = src))
QDEL_NULL(equipment_system.lock_system)
unlocked = TRUE
user.visible_message(user, "<span class='warning'>[user] has destroyed the [src]'s lock!</span>",
"<span class='notice'>You destroy the [src]'s lock!</span>")
else
user.visible_message(user, "<span class='warning'>[user] fails to break through the [src]'s lock!</span>",
"<span class='notice'>You were unable to break through the [src]'s lock!</span>")
return
if(L.on && unlocked == FALSE) //The buster is on, we don't have a lock system, and the pod is still somehow locked, unlocking.
unlocked = TRUE
user.visible_message(user, "<span class='warning'>[user] has destroyed the [src]'s malfunction that locks the doors!</span>",
"<span class='notice'>You destroy the [src]'s malfunction that locks the doors!</span>")
to_chat(user, "<span class='notice'>Turn the [L] on first.</span>")
return
@@ -825,11 +830,15 @@ obj/spacepod/proc/add_equipment(mob/user, var/obj/item/device/spacepod_equipment
return
if(usr in passengers && usr != src.pilot)
to_chat(usr, "<span class='notice'>You can't reach the controls from your chair")
to_chat(usr, "<span class='notice'>You can't reach the controls from your chair.")
return
unlocked = !unlocked
to_chat(usr, "<span class='warning'>You [unlocked ? "unlock" : "lock"] the doors.</span>")
if(!equipment_system.lock_system)
to_chat(usr, "<span class='notice'>There is no locking system you could lock.")
unlocked = TRUE //Should never be true without a lock, but if it somehow happens, that will force an unlock.
else
unlocked = !unlocked
to_chat(usr, "<span class='warning'>You [unlocked ? "unlock" : "lock"] the doors.</span>")
/obj/spacepod/verb/toggleDoors()