Difference between revisions of "Dynamically Attaching Scripts"
Dynamically Attaching Scripts (edit)
Revision as of 12:04, 20 February 2015
, 12:04, 20 February 2015Modified code slightly to check if the quest is completely stopped, with failover after 5 seconds. Should result in less waiting and more reliability.
imported>Sagitarius22 |
imported>Chesko (Modified code slightly to check if the quest is completely stopped, with failover after 5 seconds. Should result in less waiting and more reliability.) |
||
Line 365: | Line 365: | ||
Event OnUpdate() | Event OnUpdate() | ||
DASQuest.Stop() | DASQuest.Stop() | ||
;We must wait until the quest has stopped before restarting the quest. Using Stop() and immediately Start() may fail. | |||
;Continue after 5 seconds to prevent infinite loop. | |||
int i = 0 | |||
while !DASQuest.IsStopped() && i < 50 | |||
Utility.Wait(0.1) | |||
i += 1 | |||
endWhile | |||
DASQuest.Start() | DASQuest.Start() | ||
RegisterForSingleUpdate(5) | RegisterForSingleUpdate(5) |