Fix runtime errors when uninstalling some nifsofts

* /datum/nifsoft/uninstall() sets nif = null, so any overriden uninstall() that calls parent can't access the nif after that.   Luckily the only nifsofts that did this were just clearing flags that they set on install().
* We have an automatic flag set/clearing mechanism using some variables which sets them on install and clears on uninstall, so we switch to that and its all good.
This commit is contained in:
Leshana
2017-06-14 16:04:45 -04:00
parent 43bf8e7d88
commit e316b76ddb
2 changed files with 3 additions and 26 deletions
+2 -16
View File
@@ -8,14 +8,7 @@
wear = 3
access = 999 //Prevents anyone from buying it without an emag.
activates = FALSE //It's armor.
install()
if((. = ..()))
nif.set_flag(NIF_C_BRUTEARMOR,NIF_FLAGS_COMBAT)
uninstall()
. = ..()
nif.clear_flag(NIF_C_BRUTEARMOR,NIF_FLAGS_COMBAT)
combat_flags = NIF_C_BRUTEARMOR // Default on when installed, clear when uninstalled
/datum/nifsoft/burn_armor
name = "Dragon's Skin"
@@ -27,14 +20,7 @@
wear = 3
access = 999 //Prevents anyone from buying it without an emag.
activates = FALSE //It's armor.
install()
if((. = ..()))
nif.set_flag(NIF_C_BURNARMOR,NIF_FLAGS_COMBAT)
uninstall()
. = ..()
nif.clear_flag(NIF_C_BURNARMOR,NIF_FLAGS_COMBAT)
combat_flags = NIF_C_BURNARMOR // Default on when installed, clear when uninstalled
/datum/nifsoft/painkillers
name = "Nova Shock"
@@ -15,6 +15,7 @@
cost = 1265
wear = 1
p_drain = 0.01
other_flags = (NIF_O_SCMYSELF|NIF_O_SCOTHERS) // Default on when installed, clear when uninstalled
var/setting_flags = (NIF_SC_CATCHING_ME|NIF_SC_CATCHING_OTHERS|NIF_SC_ALLOW_EARS|NIF_SC_ALLOW_EYES|NIF_SC_BACKUPS)
var/list/brainmobs = list()
@@ -28,16 +29,6 @@
qdel_null_list(brainmobs)
return ..()
install()
if((. = ..()))
nif.set_flag(NIF_O_SCMYSELF,NIF_FLAGS_OTHER)
nif.set_flag(NIF_O_SCOTHERS,NIF_FLAGS_OTHER)
uninstall()
if((. = ..()))
nif.clear_flag(NIF_O_SCMYSELF,NIF_FLAGS_OTHER)
nif.clear_flag(NIF_O_SCOTHERS,NIF_FLAGS_OTHER)
activate()
if((. = ..()))
show_settings(nif.human)