mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +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
|
||||
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 << "<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
|
||||
|
||||
if(G.slot && !(G.slot in custom_equip_slots))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -131,6 +131,7 @@
|
||||
prefs.last_id = computer_id //these are gonna be used for banning
|
||||
|
||||
. = ..() //calls mob.Login()
|
||||
prefs.sanitize_preferences()
|
||||
|
||||
if(custom_event_msg && custom_event_msg != "")
|
||||
src << "<h1 class='alert'>Custom Event</h1>"
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -2,14 +2,12 @@
|
||||
/datum/gear/suit/zhan_furs
|
||||
display_name = "Zhan-Khazan furs (Tajara)"
|
||||
path = /obj/item/clothing/suit/tajaran/furs
|
||||
whitelisted = "Tajara"
|
||||
sort_category = "Xenowear"
|
||||
|
||||
/datum/gear/suit/unathi_mantle
|
||||
display_name = "hide mantle (Unathi)"
|
||||
path = /obj/item/clothing/suit/unathi/mantle
|
||||
cost = 1
|
||||
whitelisted = "Unathi"
|
||||
sort_category = "Xenowear"
|
||||
|
||||
/datum/gear/ears/skrell/chains //Chains
|
||||
@@ -25,7 +23,7 @@
|
||||
var/obj/item/clothing/ears/skrell/chain/chain = chain_style
|
||||
chaintypes[initial(chain.name)] = chain
|
||||
gear_tweaks += new/datum/gear_tweak/path(sortAssoc(chaintypes))
|
||||
|
||||
|
||||
/datum/gear/ears/skrell/bands
|
||||
display_name = "headtail band selection (Skrell)"
|
||||
path = /obj/item/clothing/ears/skrell/band
|
||||
@@ -39,7 +37,7 @@
|
||||
var/obj/item/clothing/ears/skrell/band/band = band_style
|
||||
bandtypes[initial(band.name)] = band
|
||||
gear_tweaks += new/datum/gear_tweak/path(sortAssoc(bandtypes))
|
||||
|
||||
|
||||
/datum/gear/ears/skrell/cloth/male
|
||||
display_name = "male headtail cloth selection (Skrell)"
|
||||
path = /obj/item/clothing/ears/skrell/cloth_male
|
||||
@@ -73,17 +71,17 @@
|
||||
path = /obj/item/clothing/ears/skrell/colored/band
|
||||
sort_category = "Xenowear"
|
||||
whitelisted = "Skrell"
|
||||
|
||||
|
||||
/datum/gear/ears/skrell/colored/band/New()
|
||||
..()
|
||||
gear_tweaks = list(gear_tweak_free_color_choice)
|
||||
|
||||
|
||||
/datum/gear/ears/skrell/colored/chain
|
||||
display_name = "Colored chain (Skrell)"
|
||||
path = /obj/item/clothing/ears/skrell/colored/chain
|
||||
sort_category = "Xenowear"
|
||||
whitelisted = "Skrell"
|
||||
|
||||
|
||||
/datum/gear/ears/skrell/colored/chain/New()
|
||||
..()
|
||||
gear_tweaks = list(gear_tweak_free_color_choice)
|
||||
|
||||
@@ -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.
|
||||
for(var/datum/category_item/player_setup_item/PI in items)
|
||||
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)
|
||||
// Sanitize all data, then save it
|
||||
@@ -142,8 +140,6 @@
|
||||
/datum/category_group/player_setup_category/proc/load_preferences(var/savefile/S)
|
||||
for(var/datum/category_item/player_setup_item/PI in items)
|
||||
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)
|
||||
for(var/datum/category_item/player_setup_item/PI in items)
|
||||
|
||||
@@ -237,12 +237,14 @@ datum/preferences
|
||||
else if(href_list["reload"])
|
||||
load_preferences()
|
||||
load_character()
|
||||
sanitize_preferences()
|
||||
else if(href_list["load"])
|
||||
if(!IsGuestKey(usr.key))
|
||||
open_load_dialog(usr)
|
||||
return 1
|
||||
else if(href_list["changeslot"])
|
||||
load_character(text2num(href_list["changeslot"]))
|
||||
sanitize_preferences()
|
||||
close_load_dialog(usr)
|
||||
else
|
||||
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