Add type checks in case of Initialize() weirdness

This commit is contained in:
mochi
2020-06-24 11:22:35 +02:00
parent a729854312
commit bc5bab7bc1
@@ -37,6 +37,12 @@
var/mob/M = has_suit.loc
A.Grant(M)
if (islist(has_suit.armor) || isnull(has_suit.armor)) // This proc can run before /obj/Initialize has run for U and src,
has_suit.armor = getArmor(arglist(has_suit.armor)) // we have to check that the armor list has been transformed into a datum before we try to call a proc on it
// This is safe to do as /obj/Initialize only handles setting up the datum if actually needed.
if (islist(armor) || isnull(armor))
armor = getArmor(arglist(armor))
has_suit.armor = has_suit.armor.attachArmor(armor)
if(user)