mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -24,13 +24,6 @@ var/global/list/turfs = list() //list of all turfs
|
||||
#define all_genders_define_list list(MALE,FEMALE,PLURAL,NEUTER,HERM) //VOREStaton Edit
|
||||
#define all_genders_text_list list("Male","Female","Plural","Neuter","Herm") //VOREStation Edit
|
||||
|
||||
//Languages/species/whitelist.
|
||||
var/global/list/all_species[0]
|
||||
var/global/list/all_languages[0]
|
||||
var/global/list/language_keys[0] // Table of say codes for all languages
|
||||
var/global/list/whitelisted_species = list(SPECIES_HUMAN) // Species that require a whitelist check.
|
||||
var/global/list/playable_species = list(SPECIES_CUSTOM, SPECIES_HUMAN) // A list of ALL playable species, whitelisted, latejoin or otherwise. //VOREStation Edit - Making sure custom species is obvious.
|
||||
|
||||
var/list/mannequins_
|
||||
|
||||
// Posters
|
||||
@@ -164,12 +157,12 @@ var/global/list/string_slot_flags = list(
|
||||
paths = typesof(/datum/language)-/datum/language
|
||||
for(var/T in paths)
|
||||
var/datum/language/L = new T
|
||||
all_languages[L.name] = L
|
||||
GLOB.all_languages[L.name] = L
|
||||
|
||||
for (var/language_name in all_languages)
|
||||
var/datum/language/L = all_languages[language_name]
|
||||
for (var/language_name in GLOB.all_languages)
|
||||
var/datum/language/L = GLOB.all_languages[language_name]
|
||||
if(!(L.flags & NONGLOBAL))
|
||||
language_keys[lowertext(L.key)] = L
|
||||
GLOB.language_keys[lowertext(L.key)] = L
|
||||
|
||||
var/rkey = 0
|
||||
paths = typesof(/datum/species)
|
||||
@@ -183,12 +176,12 @@ var/global/list/string_slot_flags = list(
|
||||
|
||||
S = new T
|
||||
S.race_key = rkey //Used in mob icon caching.
|
||||
all_species[S.name] = S
|
||||
GLOB.all_species[S.name] = S
|
||||
|
||||
if(!(S.spawn_flags & SPECIES_IS_RESTRICTED))
|
||||
playable_species += S.name
|
||||
GLOB.playable_species += S.name
|
||||
if(S.spawn_flags & SPECIES_IS_WHITELISTED)
|
||||
whitelisted_species += S.name
|
||||
GLOB.whitelisted_species += S.name
|
||||
|
||||
//Posters
|
||||
paths = typesof(/datum/poster) - /datum/poster
|
||||
|
||||
@@ -470,10 +470,10 @@ var/global/list/remainless_species = list(SPECIES_PROMETHEAN,
|
||||
|
||||
// Custom species icon bases
|
||||
var/list/blacklisted_icons = list(SPECIES_CUSTOM,SPECIES_PROMETHEAN) //Just ones that won't work well.
|
||||
for(var/species_name in playable_species)
|
||||
for(var/species_name in GLOB.playable_species)
|
||||
if(species_name in blacklisted_icons)
|
||||
continue
|
||||
var/datum/species/S = all_species[species_name]
|
||||
var/datum/species/S = GLOB.all_species[species_name]
|
||||
if(S.spawn_flags & SPECIES_IS_WHITELISTED)
|
||||
continue
|
||||
custom_species_bases += species_name
|
||||
|
||||
@@ -75,7 +75,7 @@ proc/random_facial_hair_style(gender, species = SPECIES_HUMAN)
|
||||
proc/sanitize_name(name, species = SPECIES_HUMAN, robot = 0)
|
||||
var/datum/species/current_species
|
||||
if(species)
|
||||
current_species = all_species[species]
|
||||
current_species = GLOB.all_species[species]
|
||||
|
||||
return current_species ? current_species.sanitize_name(name, robot) : sanitizeName(name, MAX_NAME_LEN, robot)
|
||||
|
||||
@@ -83,7 +83,7 @@ proc/random_name(gender, species = SPECIES_HUMAN)
|
||||
|
||||
var/datum/species/current_species
|
||||
if(species)
|
||||
current_species = all_species[species]
|
||||
current_species = GLOB.all_species[species]
|
||||
|
||||
if(!current_species || current_species.name_language == null)
|
||||
if(gender==FEMALE)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// Run all strings to be used in an SQL query through this proc first to properly escape out injection attempts.
|
||||
/proc/sanitizeSQL(var/t as text)
|
||||
var/sqltext = dbcon.Quote(t);
|
||||
return copytext(sqltext, 2, lentext(sqltext));//Quote() adds quotes around input, we already do that
|
||||
return copytext(sqltext, 2, length(sqltext));//Quote() adds quotes around input, we already do that
|
||||
|
||||
/*
|
||||
* Text sanitization
|
||||
@@ -249,9 +249,9 @@
|
||||
//This is used for fingerprints
|
||||
/proc/stringmerge(var/text,var/compare,replace = "*")
|
||||
var/newtext = text
|
||||
if(lentext(text) != lentext(compare))
|
||||
if(length(text) != length(compare))
|
||||
return 0
|
||||
for(var/i = 1, i < lentext(text), i++)
|
||||
for(var/i = 1, i < length(text), i++)
|
||||
var/a = copytext(text,i,i+1)
|
||||
var/b = copytext(compare,i,i+1)
|
||||
//if it isn't both the same letter, or if they are both the replacement character
|
||||
@@ -271,7 +271,7 @@
|
||||
if(!text || !character)
|
||||
return 0
|
||||
var/count = 0
|
||||
for(var/i = 1, i <= lentext(text), i++)
|
||||
for(var/i = 1, i <= length(text), i++)
|
||||
var/a = copytext(text,i,i+1)
|
||||
if(a == character)
|
||||
count++
|
||||
@@ -286,8 +286,8 @@
|
||||
//Used in preferences' SetFlavorText and human's set_flavor verb
|
||||
//Previews a string of len or less length
|
||||
proc/TextPreview(var/string,var/len=40)
|
||||
if(lentext(string) <= len)
|
||||
if(!lentext(string))
|
||||
if(length(string) <= len)
|
||||
if(!length(string))
|
||||
return "\[...\]"
|
||||
else
|
||||
return string
|
||||
|
||||
@@ -590,10 +590,6 @@ Turf and target are seperate in case you want to teleport some distance from a t
|
||||
/proc/between(var/low, var/middle, var/high)
|
||||
return max(min(middle, high), low)
|
||||
|
||||
proc/arctan(x)
|
||||
var/y=arcsin(x/sqrt(1+x*x))
|
||||
return y
|
||||
|
||||
//returns random gauss number
|
||||
proc/GaussRand(var/sigma)
|
||||
var/x,y,rsq
|
||||
|
||||
Reference in New Issue
Block a user