mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Merge pull request #2269 from Yoshax/xenoloadout
Fixes loadout sanitisation setup stuff or something
This commit is contained in:
@@ -342,11 +342,13 @@ var/global/datum/controller/occupations/job_master
|
|||||||
else
|
else
|
||||||
permitted = 1
|
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
|
permitted = 0
|
||||||
|
|
||||||
if(!permitted)
|
if(!permitted)
|
||||||
H << "<span class='warning'>Your current job or whitelist status does not permit you to spawn with [thing]!</span>"
|
H << "<span class='warning'>Your current species, job or whitelist status does not permit you to spawn with [thing]!</span>"
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if(G.slot && !(G.slot in custom_equip_slots))
|
if(G.slot && !(G.slot in custom_equip_slots))
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ var/list/whitelist = list()
|
|||||||
/proc/whitelist_overrides(mob/M)
|
/proc/whitelist_overrides(mob/M)
|
||||||
if(!config.usealienwhitelist)
|
if(!config.usealienwhitelist)
|
||||||
return 1
|
return 1
|
||||||
if(check_rights(R_ADMIN, 0))
|
if(check_rights(R_ADMIN, 0, M))
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -131,6 +131,7 @@
|
|||||||
prefs.last_id = computer_id //these are gonna be used for banning
|
prefs.last_id = computer_id //these are gonna be used for banning
|
||||||
|
|
||||||
. = ..() //calls mob.Login()
|
. = ..() //calls mob.Login()
|
||||||
|
prefs.sanitize_preferences()
|
||||||
|
|
||||||
if(custom_event_msg && custom_event_msg != "")
|
if(custom_event_msg && custom_event_msg != "")
|
||||||
src << "<h1 class='alert'>Custom Event</h1>"
|
src << "<h1 class='alert'>Custom Event</h1>"
|
||||||
|
|||||||
@@ -52,15 +52,17 @@ var/list/gear_datums = list()
|
|||||||
S["gear"] << pref.gear
|
S["gear"] << pref.gear
|
||||||
|
|
||||||
/datum/category_item/player_setup_item/loadout/proc/valid_gear_choices(var/max_cost)
|
/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)
|
for(var/gear_name in gear_datums)
|
||||||
var/datum/gear/G = gear_datums[gear_name]
|
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
|
continue
|
||||||
if(max_cost && G.cost > max_cost)
|
if(max_cost && G.cost > max_cost)
|
||||||
continue
|
continue
|
||||||
valid_gear_choices += gear_name
|
. += gear_name
|
||||||
return valid_gear_choices
|
|
||||||
|
|
||||||
/datum/category_item/player_setup_item/loadout/sanitize_character()
|
/datum/category_item/player_setup_item/loadout/sanitize_character()
|
||||||
if(!islist(pref.gear))
|
if(!islist(pref.gear))
|
||||||
|
|||||||
@@ -2,14 +2,12 @@
|
|||||||
/datum/gear/suit/zhan_furs
|
/datum/gear/suit/zhan_furs
|
||||||
display_name = "Zhan-Khazan furs (Tajara)"
|
display_name = "Zhan-Khazan furs (Tajara)"
|
||||||
path = /obj/item/clothing/suit/tajaran/furs
|
path = /obj/item/clothing/suit/tajaran/furs
|
||||||
whitelisted = "Tajara"
|
|
||||||
sort_category = "Xenowear"
|
sort_category = "Xenowear"
|
||||||
|
|
||||||
/datum/gear/suit/unathi_mantle
|
/datum/gear/suit/unathi_mantle
|
||||||
display_name = "hide mantle (Unathi)"
|
display_name = "hide mantle (Unathi)"
|
||||||
path = /obj/item/clothing/suit/unathi/mantle
|
path = /obj/item/clothing/suit/unathi/mantle
|
||||||
cost = 1
|
cost = 1
|
||||||
whitelisted = "Unathi"
|
|
||||||
sort_category = "Xenowear"
|
sort_category = "Xenowear"
|
||||||
|
|
||||||
/datum/gear/ears/skrell/chains //Chains
|
/datum/gear/ears/skrell/chains //Chains
|
||||||
|
|||||||
@@ -129,8 +129,6 @@
|
|||||||
// Need due to, for example, the 01_basic module relying on species having been loaded to sanitize correctly but that isn't loaded until module 03_body.
|
// Need due to, for example, the 01_basic module relying on species having been loaded to sanitize correctly but that isn't loaded until module 03_body.
|
||||||
for(var/datum/category_item/player_setup_item/PI in items)
|
for(var/datum/category_item/player_setup_item/PI in items)
|
||||||
PI.load_character(S)
|
PI.load_character(S)
|
||||||
for(var/datum/category_item/player_setup_item/PI in items)
|
|
||||||
PI.sanitize_character()
|
|
||||||
|
|
||||||
/datum/category_group/player_setup_category/proc/save_character(var/savefile/S)
|
/datum/category_group/player_setup_category/proc/save_character(var/savefile/S)
|
||||||
// Sanitize all data, then save it
|
// Sanitize all data, then save it
|
||||||
@@ -142,8 +140,6 @@
|
|||||||
/datum/category_group/player_setup_category/proc/load_preferences(var/savefile/S)
|
/datum/category_group/player_setup_category/proc/load_preferences(var/savefile/S)
|
||||||
for(var/datum/category_item/player_setup_item/PI in items)
|
for(var/datum/category_item/player_setup_item/PI in items)
|
||||||
PI.load_preferences(S)
|
PI.load_preferences(S)
|
||||||
for(var/datum/category_item/player_setup_item/PI in items)
|
|
||||||
PI.sanitize_preferences()
|
|
||||||
|
|
||||||
/datum/category_group/player_setup_category/proc/save_preferences(var/savefile/S)
|
/datum/category_group/player_setup_category/proc/save_preferences(var/savefile/S)
|
||||||
for(var/datum/category_item/player_setup_item/PI in items)
|
for(var/datum/category_item/player_setup_item/PI in items)
|
||||||
|
|||||||
@@ -237,12 +237,14 @@ datum/preferences
|
|||||||
else if(href_list["reload"])
|
else if(href_list["reload"])
|
||||||
load_preferences()
|
load_preferences()
|
||||||
load_character()
|
load_character()
|
||||||
|
sanitize_preferences()
|
||||||
else if(href_list["load"])
|
else if(href_list["load"])
|
||||||
if(!IsGuestKey(usr.key))
|
if(!IsGuestKey(usr.key))
|
||||||
open_load_dialog(usr)
|
open_load_dialog(usr)
|
||||||
return 1
|
return 1
|
||||||
else if(href_list["changeslot"])
|
else if(href_list["changeslot"])
|
||||||
load_character(text2num(href_list["changeslot"]))
|
load_character(text2num(href_list["changeslot"]))
|
||||||
|
sanitize_preferences()
|
||||||
close_load_dialog(usr)
|
close_load_dialog(usr)
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
36
html/changelogs/Yoshax - Xeno.yml
Normal file
36
html/changelogs/Yoshax - Xeno.yml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
################################
|
||||||
|
# Example Changelog File
|
||||||
|
#
|
||||||
|
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
|
||||||
|
#
|
||||||
|
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
|
||||||
|
# When it is, any changes listed below will disappear.
|
||||||
|
#
|
||||||
|
# Valid Prefixes:
|
||||||
|
# bugfix
|
||||||
|
# wip (For works in progress)
|
||||||
|
# tweak
|
||||||
|
# soundadd
|
||||||
|
# sounddel
|
||||||
|
# rscadd (general adding of nice things)
|
||||||
|
# rscdel (general deleting of nice things)
|
||||||
|
# imageadd
|
||||||
|
# imagedel
|
||||||
|
# maptweak
|
||||||
|
# spellcheck (typo fixes)
|
||||||
|
# experiment
|
||||||
|
#################################
|
||||||
|
|
||||||
|
# Your name.
|
||||||
|
author: Yoshax
|
||||||
|
|
||||||
|
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
|
||||||
|
delete-after: True
|
||||||
|
|
||||||
|
# Any changes you've made. See valid prefix list above.
|
||||||
|
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
|
||||||
|
# SCREW THIS UP AND IT WON'T WORK.
|
||||||
|
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
|
||||||
|
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
|
||||||
|
changes:
|
||||||
|
- bugfix: "Xeno loadout items will now properly be reloaded into a slot when the server restarts."
|
||||||
Reference in New Issue
Block a user