From 3b0b19f6b64f4ad0bb4b74315e228d9d9b693b26 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sun, 14 May 2017 19:42:51 -0500 Subject: [PATCH 1/3] Fixes role polls --- code/__HELPERS/game.dm.rej | 42 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 code/__HELPERS/game.dm.rej diff --git a/code/__HELPERS/game.dm.rej b/code/__HELPERS/game.dm.rej new file mode 100644 index 0000000000..81d778a232 --- /dev/null +++ b/code/__HELPERS/game.dm.rej @@ -0,0 +1,42 @@ +diff a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm (rejected hunks) +@@ -449,15 +449,13 @@ + for(var/mob/dead/observer/G in GLOB.player_list) + candidates += G + +- pollCandidates(Question, jobbanType, gametypeCheck, be_special_flag, poll_time, ignore_category, flashwindow, candidates) +- +- return candidates ++ return pollCandidates(Question, jobbanType, gametypeCheck, be_special_flag, poll_time, ignore_category, flashwindow, candidates) + + /proc/pollCandidates(Question, jobbanType, datum/game_mode/gametypeCheck, be_special_flag = 0, poll_time = 300, ignore_category = null, flashwindow = TRUE, list/group = null) + var/time_passed = world.time + if (!Question) + Question = "Would you like to be a special role?" +- ++ var/list/result = list() + for(var/m in group) + var/mob/M = m + if(!M.key || !M.client || (ignore_category && GLOB.poll_ignore[ignore_category] && M.ckey in GLOB.poll_ignore[ignore_category])) +@@ -472,17 +470,17 @@ + if(jobban_isbanned(M, jobbanType) || jobban_isbanned(M, "Syndicate")) + continue + +- showCandidatePollWindow(M, poll_time, Question, group, ignore_category, time_passed, flashwindow) ++ showCandidatePollWindow(M, poll_time, Question, result, ignore_category, time_passed, flashwindow) + sleep(poll_time) + + //Check all our candidates, to make sure they didn't log off or get deleted during the wait period. +- for(var/mob/M in group) ++ for(var/mob/M in result) + if(!M.key || !M.client) +- group -= M ++ result -= M + +- listclearnulls(group) ++ listclearnulls(result) + +- return group ++ return result + + /proc/pollCandidatesForMob(Question, jobbanType, datum/game_mode/gametypeCheck, be_special_flag = 0, poll_time = 300, mob/M, ignore_category = null) + var/list/L = pollGhostCandidates(Question, jobbanType, gametypeCheck, be_special_flag, poll_time, ignore_category) From a8a862411d5f1af2985faf124170c9899795ecf9 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Thu, 18 May 2017 02:31:07 -0500 Subject: [PATCH 2/3] commit --- code/__HELPERS/game.dm | 15 +++++++------- code/__HELPERS/game.dm.rej | 42 -------------------------------------- 2 files changed, 7 insertions(+), 50 deletions(-) delete mode 100644 code/__HELPERS/game.dm.rej diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index e93de5dccc..9384e3fcfe 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -449,15 +449,14 @@ for(var/mob/dead/observer/G in GLOB.player_list) candidates += G - pollCandidates(Question, jobbanType, gametypeCheck, be_special_flag, poll_time, ignore_category, flashwindow, candidates) - - return candidates +return pollCandidates(Question, jobbanType, gametypeCheck, be_special_flag, poll_time, ignore_category, flashwindow, candidates) /proc/pollCandidates(Question, jobbanType, datum/game_mode/gametypeCheck, be_special_flag = 0, poll_time = 300, ignore_category = null, flashwindow = TRUE, list/group = null) var/time_passed = world.time if (!Question) Question = "Would you like to be a special role?" + var/list/result = list() for(var/m in group) var/mob/M = m if(!M.key || !M.client || (ignore_category && GLOB.poll_ignore[ignore_category] && M.ckey in GLOB.poll_ignore[ignore_category])) @@ -472,17 +471,17 @@ if(jobban_isbanned(M, jobbanType) || jobban_isbanned(M, "Syndicate")) continue - showCandidatePollWindow(M, poll_time, Question, group, ignore_category, time_passed, flashwindow) + showCandidatePollWindow(M, poll_time, Question, result, ignore_category, time_passed, flashwindow) sleep(poll_time) //Check all our candidates, to make sure they didn't log off or get deleted during the wait period. - for(var/mob/M in group) + for(var/mob/M in result) if(!M.key || !M.client) - group -= M + result -= M - listclearnulls(group) + listclearnulls(result) - return group + return result /proc/pollCandidatesForMob(Question, jobbanType, datum/game_mode/gametypeCheck, be_special_flag = 0, poll_time = 300, mob/M, ignore_category = null) var/list/L = pollGhostCandidates(Question, jobbanType, gametypeCheck, be_special_flag, poll_time, ignore_category) diff --git a/code/__HELPERS/game.dm.rej b/code/__HELPERS/game.dm.rej deleted file mode 100644 index 81d778a232..0000000000 --- a/code/__HELPERS/game.dm.rej +++ /dev/null @@ -1,42 +0,0 @@ -diff a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm (rejected hunks) -@@ -449,15 +449,13 @@ - for(var/mob/dead/observer/G in GLOB.player_list) - candidates += G - -- pollCandidates(Question, jobbanType, gametypeCheck, be_special_flag, poll_time, ignore_category, flashwindow, candidates) -- -- return candidates -+ return pollCandidates(Question, jobbanType, gametypeCheck, be_special_flag, poll_time, ignore_category, flashwindow, candidates) - - /proc/pollCandidates(Question, jobbanType, datum/game_mode/gametypeCheck, be_special_flag = 0, poll_time = 300, ignore_category = null, flashwindow = TRUE, list/group = null) - var/time_passed = world.time - if (!Question) - Question = "Would you like to be a special role?" -- -+ var/list/result = list() - for(var/m in group) - var/mob/M = m - if(!M.key || !M.client || (ignore_category && GLOB.poll_ignore[ignore_category] && M.ckey in GLOB.poll_ignore[ignore_category])) -@@ -472,17 +470,17 @@ - if(jobban_isbanned(M, jobbanType) || jobban_isbanned(M, "Syndicate")) - continue - -- showCandidatePollWindow(M, poll_time, Question, group, ignore_category, time_passed, flashwindow) -+ showCandidatePollWindow(M, poll_time, Question, result, ignore_category, time_passed, flashwindow) - sleep(poll_time) - - //Check all our candidates, to make sure they didn't log off or get deleted during the wait period. -- for(var/mob/M in group) -+ for(var/mob/M in result) - if(!M.key || !M.client) -- group -= M -+ result -= M - -- listclearnulls(group) -+ listclearnulls(result) - -- return group -+ return result - - /proc/pollCandidatesForMob(Question, jobbanType, datum/game_mode/gametypeCheck, be_special_flag = 0, poll_time = 300, mob/M, ignore_category = null) - var/list/L = pollGhostCandidates(Question, jobbanType, gametypeCheck, be_special_flag, poll_time, ignore_category) From 61f88192864d35f47df3fea0eba0541c96c62e15 Mon Sep 17 00:00:00 2001 From: LetterJay Date: Thu, 18 May 2017 02:37:12 -0500 Subject: [PATCH 3/3] oops --- code/__HELPERS/game.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm index 9384e3fcfe..104646170d 100644 --- a/code/__HELPERS/game.dm +++ b/code/__HELPERS/game.dm @@ -424,7 +424,7 @@ switch(ignore_category ? askuser(M,Question,"Please answer in [poll_time/10] seconds!","Yes","No","Never for this round", StealFocus=0, Timeout=poll_time) : askuser(M,Question,"Please answer in [poll_time/10] seconds!","Yes","No", StealFocus=0, Timeout=poll_time)) if(1) to_chat(M, "Choice registered: Yes.") - if((world.time-time_passed)>poll_time) + if(time_passed + poll_time <= world.time) to_chat(M, "Sorry, you answered too late to be considered!") M << 'sound/machines/buzz-sigh.ogg' candidates -= M @@ -449,7 +449,7 @@ for(var/mob/dead/observer/G in GLOB.player_list) candidates += G -return pollCandidates(Question, jobbanType, gametypeCheck, be_special_flag, poll_time, ignore_category, flashwindow, candidates) + return pollCandidates(Question, jobbanType, gametypeCheck, be_special_flag, poll_time, ignore_category, flashwindow, candidates) /proc/pollCandidates(Question, jobbanType, datum/game_mode/gametypeCheck, be_special_flag = 0, poll_time = 300, ignore_category = null, flashwindow = TRUE, list/group = null) var/time_passed = world.time