Skip to content

Commit

Permalink
lets try another way of doing this.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrStonedOne committed Feb 14, 2016
1 parent 94ca3fb commit 2663cb2
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions code/controllers/subsystem/pai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var/datum/subsystem/pai/SSpai
priority = 20

var/askDelay = 600

var/const/NEVER_FOR_THIS_ROUND = -1
var/list/candidates = list()
var/list/asked = list()

Expand Down Expand Up @@ -183,11 +183,11 @@ var/datum/subsystem/pai/SSpai
for(var/mob/dead/observer/O in player_list)
if(jobban_isbanned(O, ROLE_PAI))
continue
if(asked.Find(O.key))
if(world.time < asked[O.key] + askDelay)
if(asked[O.ckey])
if(world.time < asked[O.ckey] + askDelay || asked[O.ckey] == NEVER_FOR_THIS_ROUND)
continue
else
asked.Remove(O.key)
asked.Remove(O.ckey)
if(O.client)
var/hasSubmitted = 0
for(var/datum/paiCandidate/c in SSpai.candidates)
Expand All @@ -200,15 +200,14 @@ var/datum/subsystem/pai/SSpai
set waitfor = 0
if(!C)
return
asked.Add(C.key)
asked[C.key] = world.time
asked[C.ckey] = world.time
var/response = tgalert(C, "Someone is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request", "Yes", "No", "Never for this round", StealFocus=0, Timeout=askDelay)
if(!C)
return //handle logouts that happen whilst the alert is waiting for a response.
if(response == "Yes")
recruitWindow(C.mob)
else if (response == "Never for this round")
C.prefs.be_special -= ROLE_PAI
asked[C.ckey] = NEVER_FOR_THIS_ROUND

/datum/paiCandidate
var/name
Expand Down

0 comments on commit 2663cb2

Please sign in to comment.