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:
elly1989@rocketmail.com
2012-05-02 04:44:16 +00:00
parent 10656c239b
commit 37f471ff41
3 changed files with 100 additions and 81 deletions
+11 -8
View File
@@ -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