diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 342ce021d74..b35b0834bee 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -397,14 +397,14 @@ return new /datum/projectile_data(src_x, src_y, time, distance, power_x, power_y, dest_x, dest_y) -/proc/pollCandidates(var/Question, var/jobbanType, var/datum/game_mode/gametypeCheck, var/be_special_flag = 0, var/poll_time = 300, var/ignore_list = null) +/proc/pollCandidates(var/Question, var/jobbanType, var/datum/game_mode/gametypeCheck, var/be_special_flag = 0, var/poll_time = 300, var/ignore_category = null) var/list/mob/dead/observer/candidates = list() var/time_passed = world.time if (!Question) Question = "Would you like to be a special role?" for(var/mob/dead/observer/G in player_list) - if(!G.key || !G.client || (ignore_list && G.ckey in ignore_list)) + if(!G.key || !G.client || (ignore_category && G.ckey in poll_ignore[ignore_category])) continue if(be_special_flag) if(!(G.client.prefs) || !(be_special_flag in G.client.prefs.be_special)) @@ -417,7 +417,7 @@ continue spawn(0) G << 'sound/misc/notice2.ogg' //Alerting them to their consideration - switch(ignore_list ? askuser(G,Question,"Please answer in [poll_time/10] seconds!","Yes","No","Never for this round", StealFocus=0, Timeout=poll_time) : askuser(G,Question,"Please answer in [poll_time/10] seconds!","Yes","No", StealFocus=0, Timeout=poll_time)) + switch(ignore_category ? askuser(G,Question,"Please answer in [poll_time/10] seconds!","Yes","No","Never for this round", StealFocus=0, Timeout=poll_time) : askuser(G,Question,"Please answer in [poll_time/10] seconds!","Yes","No", StealFocus=0, Timeout=poll_time)) if(1) G << "Choice registered: Yes." if((world.time-time_passed)>poll_time) @@ -428,7 +428,7 @@ if(2) G << "Choice registered: No." if(3) - ignore_list[G.ckey] = 1 + poll_ignore[ignore_category] += G.ckey G << "Choice registered: Never for this round." sleep(poll_time) diff --git a/code/_globalvars/lists/poll_ignore.dm b/code/_globalvars/lists/poll_ignore.dm index 2683dfdd4d4..e7d565aa36b 100644 --- a/code/_globalvars/lists/poll_ignore.dm +++ b/code/_globalvars/lists/poll_ignore.dm @@ -1,4 +1,6 @@ //Each lists stores ckeys for "Never for this round" option category -var/list/sentience_potion_ignore = list() //sentience potion query -var/list/pai_ignore = list() //pai's \ No newline at end of file +#define POLL_IGNORE_PAI "pai" +#define POLL_IGNORE_SENTIENCE_POTION "sentience_potion" + +var/list/poll_ignore = list(POLL_IGNORE_PAI = list(),POLL_IGNORE_SENTIENCE_POTION = list()) \ No newline at end of file diff --git a/code/controllers/subsystem/pai.dm b/code/controllers/subsystem/pai.dm index e71bbd8edb4..f3dcb49e6c3 100644 --- a/code/controllers/subsystem/pai.dm +++ b/code/controllers/subsystem/pai.dm @@ -178,7 +178,7 @@ var/datum/subsystem/pai/SSpai user << browse(dat, "window=findPai") /datum/subsystem/pai/proc/requestRecruits() - var/list/candidates = pollCandidates("Someone is requesting a pAI personality. Would you like to play as a personal AI?", ROLE_PAI, null, ROLE_PAI,300, ignore_list = pai_ignore) + var/list/candidates = pollCandidates("Someone is requesting a pAI personality. Would you like to play as a personal AI?", ROLE_PAI, null, ROLE_PAI,300, ignore_category = POLL_IGNORE_PAI) for(var/V in candidates) recruitWindow(V) return diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 9c6626ec650..3c87feff6e9 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -184,7 +184,7 @@ user << "You offer the sentience potion to [SM]..." being_used = 1 - var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as [SM.name]?", ROLE_ALIEN, null, ROLE_ALIEN, 50, sentience_potion_ignore) // see poll_ignore.dm + var/list/mob/dead/observer/candidates = pollCandidates("Do you want to play as [SM.name]?", ROLE_ALIEN, null, ROLE_ALIEN, 50, POLL_IGNORE_SENTIENCE_POTION) // see poll_ignore.dm var/mob/dead/observer/theghost = null if(candidates.len) theghost = pick(candidates)