Init client when scripts loaded and ready

This commit is contained in:
Vortrex
2022-05-15 04:14:54 -05:00
parent 7e53994a5a
commit 63c1499e74

View File

@@ -59,8 +59,13 @@ function addAllEventHandlers() {
function onResourceStart(event, resource) {
sendResourceStartedSignalToServer();
setUpInitialGame();
garbageCollectorInterval = setInterval(collectAllGarbage, 1000*60);
//setUpInitialGame();
//garbageCollectorInterval = setInterval(collectAllGarbage, 1000*60);
resourceStarted = true;
if(resourceReady == true) {
initClient();
}
}
// ===========================================================================
@@ -73,6 +78,10 @@ function onResourceStop(event, resource) {
function onResourceReady(event, resource) {
sendResourceReadySignalToServer();
resourceReady = true;
if(resourceStarted == true) {
initClient();
}
}
// ===========================================================================