Fixing a number of issues with burial mounds and abandoned crates. (#64482)

Ok, I'm fixing a few issues with certain crates, namely the abandoned one and the burial mound:

    An oversight with the skittish trait letting players dive into burial mounds, which are technically a subtype of crates.
    A runtime that made abandoned crates not update their lock lights when unlocked (the togglelock call was missing the user arg). This one was my fault.
    An oversight with abandoned crates not resetting the number of attempts left and not nulling the last attempted code when re-locked. Idem.
    Burial mounds somehow getting lock lights overlays.

Also i'm taking this opportunity to make the closets unit test not early return at the first encountered failure (at the time I made it I didn't know TEST_ASSERT & co would early return on failure) since we want this unit test to finish looping through all non-blacklisted closets.
This commit is contained in:
Ghom
2022-02-01 00:41:36 -03:00
committed by GitHub
parent ae0cbc261e
commit 10da33131e
4 changed files with 18 additions and 17 deletions
+5 -3
View File
@@ -30,7 +30,7 @@
if(locked)
to_chat(user, span_notice("The crate is locked with a Deca-code lock."))
var/input = input(usr, "Enter [codelen] digits. All digits must be unique.", "Deca-Code Lock", "") as text|null
if(user.canUseTopic(src, BE_CLOSE))
if(user.canUseTopic(src, BE_CLOSE) && locked)
var/list/sanitised = list()
var/sanitycheck = TRUE
var/char = ""
@@ -43,7 +43,6 @@
if(sanitised[i] == sanitised[j])
sanitycheck = FALSE //if a digit is repeated, reject the input
if(input == code)
to_chat(user, span_notice("The crate unlocks!"))
if(!spawned_loot)
spawn_loot()
tamperproof = 0 // set explosion chance to zero, so we dont accidently hit it with a multitool and instantly die
@@ -109,7 +108,10 @@
if(!locked)
. = ..()
if(locked)
tamperproof = initial(tamperproof) //reset the anti-tampering when the lock is re-enabled.
//reset the anti-tampering, number of attempts and last attempt when the lock is re-enabled.
tamperproof = initial(tamperproof)
attempts = initial(attempts)
lastattempt = null
return
if(tamperproof)
boom(user)