mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-28 14:37:04 +01:00
Fixes a pAI requests runtime caused by clients disconnecting.
Fixes a host of runtimes caused by lag delaying "transmissions" between telecomms machines. Various objects were being deconstructed during this lagtime resulting in a bunch of weird null errors. Tested for 24hours on another server. Seems to be all ok. Added some rudimentary checks to advanced proccall. Calling procs owned by objects is now a little less prone to runtimes. still a bunch of stuff to do to get it safe enough though. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3542 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -193,13 +193,16 @@ var/datum/paiController/paiController // Global handler for pAI candidates
|
||||
if(c.key == O.key)
|
||||
hasSubmitted = 1
|
||||
if(!hasSubmitted && O.client.be_pai)
|
||||
spawn question(O.client)
|
||||
question(O.client)
|
||||
|
||||
proc/question(var/client/C)
|
||||
asked.Add(C.key)
|
||||
asked[C.key] = world.time
|
||||
var/response = alert(C, "Someone is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request", "Yes", "No", "Never for this round")
|
||||
if(response == "Yes")
|
||||
recruitWindow(C.mob)
|
||||
else if (response == "Never for this round")
|
||||
C.be_pai = 0
|
||||
spawn(0)
|
||||
if(!C) return
|
||||
asked.Add(C.key)
|
||||
asked[C.key] = world.time
|
||||
var/response = alert(C, "Someone is requesting a pAI personality. Would you like to play as a personal AI?", "pAI Request", "Yes", "No", "Never for this round")
|
||||
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.be_pai = 0
|
||||
Reference in New Issue
Block a user