[s] Improves and secures trait assignment code, allows their pref to be changed midround, tweaks RDS and Night Vision (#36160)

* Traits but less buggy

* no tick while dead

* fix security vuln
This commit is contained in:
Ashe Higgs
2018-03-06 15:57:42 +02:00
committed by vuonojenmustaturska
parent 9668b7230d
commit 5c8d845f56
12 changed files with 54 additions and 24 deletions
+2 -6
View File
@@ -879,15 +879,14 @@ GLOBAL_LIST_EMPTY(preferences_datums)
return 1
else if(href_list["preference"] == "trait")
if(SSticker.HasRoundStarted() && !isnewplayer(user))
to_chat(user, "<span class='danger'>The round has already started. Please wait until next round to set up your traits!</span>")
return
switch(href_list["task"])
if("close")
user << browse(null, "window=mob_occupation")
ShowChoices(user)
if("update")
var/trait = href_list["trait"]
if(!SStraits.traits[trait])
return
var/value = SStraits.trait_points[trait]
if(value == 0)
if(trait in neutral_traits)
@@ -1459,6 +1458,3 @@ GLOBAL_LIST_EMPTY(preferences_datums)
character.update_body()
character.update_hair()
character.update_body_parts()
if(CONFIG_GET(flag/roundstart_traits))
SStraits.AssignTraits(character, parent)