From 4d74a8f5c216904fee848e397f8ef9bdc206ba35 Mon Sep 17 00:00:00 2001 From: PsiOmegaDelta Date: Fri, 8 Apr 2016 10:31:51 +0200 Subject: [PATCH] Various fixes. Client Login() now calls ..() before setting up preferences, ensuring a mob has actually been assigned. Fixes #12560 (and probably other somehow subtle sanitation issues). The alien whitelist now checks the rights of the supplied mob, not usr. When granting xeno loadout gear the mob's current species must match the gear's whiteliste species. --- code/game/jobs/job_controller.dm | 6 ++++-- code/game/jobs/whitelist.dm | 2 +- code/modules/client/client procs.dm | 4 ++-- .../modules/client/preference_setup/loadout/loadout.dm | 10 ++++++---- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 14d772437d..766149d412 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -342,11 +342,13 @@ var/global/datum/controller/occupations/job_master else permitted = 1 - if(G.whitelisted && !is_alien_whitelisted(H, all_species[G.whitelisted])) + //if(G.whitelisted && !is_alien_whitelisted(H, all_species[G.whitelisted])) + + if(G.whitelisted && (G.whitelisted != H.species.name || !is_alien_whitelisted(H, G.whitelisted))) permitted = 0 if(!permitted) - H << "Your current job or whitelist status does not permit you to spawn with [thing]!" + H << "Your current species, job or whitelist status does not permit you to spawn with [thing]!" continue if(G.slot && !(G.slot in custom_equip_slots)) diff --git a/code/game/jobs/whitelist.dm b/code/game/jobs/whitelist.dm index 4d7106d213..9a13e066a5 100644 --- a/code/game/jobs/whitelist.dm +++ b/code/game/jobs/whitelist.dm @@ -75,7 +75,7 @@ var/list/whitelist = list() /proc/whitelist_overrides(mob/M) if(!config.usealienwhitelist) return 1 - if(check_rights(R_ADMIN, 0)) + if(check_rights(R_ADMIN, 0, M)) return 1 return 0 diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 0962d54061..ef5eb76728 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -122,6 +122,8 @@ admins += src holder.owner = src + . = ..() //calls mob.Login() + //preferences datum - also holds some persistant data for the client (because we may as well keep these datums to a minimum) prefs = preferences_datums[ckey] if(!prefs) @@ -130,8 +132,6 @@ prefs.last_ip = address //these are gonna be used for banning prefs.last_id = computer_id //these are gonna be used for banning - . = ..() //calls mob.Login() - if(custom_event_msg && custom_event_msg != "") src << "

Custom Event

" src << "

A custom event is taking place. OOC Info:

" diff --git a/code/modules/client/preference_setup/loadout/loadout.dm b/code/modules/client/preference_setup/loadout/loadout.dm index 31b510ef1a..4bee6c6566 100644 --- a/code/modules/client/preference_setup/loadout/loadout.dm +++ b/code/modules/client/preference_setup/loadout/loadout.dm @@ -52,15 +52,17 @@ var/list/gear_datums = list() S["gear"] << pref.gear /datum/category_item/player_setup_item/loadout/proc/valid_gear_choices(var/max_cost) - var/list/valid_gear_choices = list() + . = list() + var/mob/preference_mob = preference_mob() for(var/gear_name in gear_datums) var/datum/gear/G = gear_datums[gear_name] - if(G.whitelisted && !is_alien_whitelisted(preference_mob(), all_species[G.whitelisted])) + //if(G.whitelisted && !is_alien_whitelisted(preference_mob(), all_species[G.whitelisted])) + + if(G.whitelisted && !is_alien_whitelisted(preference_mob, G.whitelisted)) continue if(max_cost && G.cost > max_cost) continue - valid_gear_choices += gear_name - return valid_gear_choices + . += gear_name /datum/category_item/player_setup_item/loadout/sanitize_character() if(!islist(pref.gear))