fix for alien whitelisting

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2012-09-26 18:08:34 +10:00
parent 5ab12f802a
commit a668a45f8b
4 changed files with 11 additions and 8 deletions

View File

@@ -14,6 +14,8 @@ var/list/whitelist
return 0
return ("[M.ckey]" in whitelist)
var/list/alien_whitelist
proc/load_alienwhitelist()
var/text = file2text("config/alienwhitelist.txt")
if (!text)
@@ -23,15 +25,14 @@ proc/load_alienwhitelist()
/proc/is_alien_whitelisted(mob/M, var/species)
if(!alien_whitelist)
return
if((M.client) && (M.client.holder) && (M.client.holder.level) && (M.client.holder.level >= 5))
return 1
if(M && species)
return 0
if((M.client) && (M.client.holder) && (M.client.holder.level) && (M.client.holder.level >= 5)) return 1 if(M && species)
for (var/s in alien_whitelist)
if(findtext(s,"[M.ckey] - [species]"))
return 1
if(findtext(s,"[M.ckey] - All"))
return 1
return 0
#undef WHITELISTFILE

View File

@@ -106,7 +106,6 @@ var/list/prisonsecuritywarp = list() //prison security goes to these
var/list/prisonwarped = list() //list of players already warped
var/list/blobstart = list()
// list/traitors = list() //traitor list
var/list/alien_whitelist = list( )
var/list/cardinal = list( NORTH, SOUTH, EAST, WEST )
var/list/alldirs = list(NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST)

View File

@@ -739,12 +739,13 @@ datum/preferences
if(is_alien_whitelisted(user, "Skrell")) //Check for Skrell and admins
new_species += "Skrell"
whitelisted = 1
if(!whitelisted)
alert(user, "You cannot change your species as you need to be whitelisted. If you wish to be whitelisted contact an admin in-game, on the forums, or on IRC.")
else //Not using the whitelist? Aliens for everyone!
new_species += "Tajaran"
new_species += "Soghun"
new_species += "Skrell"
if(!whitelisted && config.usealienwhitelist)
alert(user, "You cannot change your species as you need to be whitelisted. If you wish to be whitelisted contact an admin in-game, on the forums, or on IRC.")
species = input("Please select a species", "Character Generation", null) in new_species
if(prev_species != species)
//grab one of the valid hair styles for the newly chosen species

View File

@@ -22,6 +22,8 @@
investigate_reset()
if (config.usewhitelist)
load_whitelist()
if (config.usealienwhitelist)
load_alienwhitelist()
LoadBansjob()
Get_Holiday() //~Carn, needs to be here when the station is named so :P
src.update_status()