Quick fixes + Cleanliness

Got rid of the nasty switch block in the handle_shade and replaced it with two variables set by the traits. Fixed spelling, added ..() to the apply for the shadekin traits so they apply properly. Added a check to make sure players don't spawn with traits their species shouldn't have.
This commit is contained in:
cadyn
2021-03-06 10:17:54 -08:00
parent 546b39a395
commit 9562bb7b17
2 changed files with 38 additions and 40 deletions

View File

@@ -62,6 +62,18 @@
pass = FALSE
to_chat(src,"<span class='warning'>Your custom species is not playable. Reconfigure your traits on the VORE tab.</span>")
//CHOMP Addition Begin
if(client?.prefs?.neu_traits)
for(var/T in client.prefs.neu_traits)
var/datum/trait/instance = all_traits[T]
if(client.prefs.species in instance.banned_species)
pass = FALSE
to_chat(src,"<span class='warning'>One of your traits, [instance.name], is not available for your species! Please fix this conflict and then try again.")
else if(LAZYLEN(instance.allowed_species) && !(client.prefs.species in instance.allowed_species)) //We use else if here, so as to prevent getting two errors for one trait.
pass = FALSE
to_chat(src,"<span class='warning'>One of your traits, [instance.name], is not available for your species! Please fix this conflict and then try again.")
//CHOMP Addition End
//Final popup notice
if (!pass)
spawn()