Don't delay resource start/ready signals

This commit is contained in:
Vortrex
2022-09-29 11:08:44 -05:00
parent 7e7983b74a
commit 2d8895b8d7

View File

@@ -63,13 +63,10 @@ function onResourceStart(event, resource) {
addEventHandler("OnPedExitedSphereEx", onPedExitedSphere);
}
garbageCollectorInterval = setInterval(collectAllGarbage, 1000 * 60);
localPlayerMoneyInterval = setInterval(updateLocalPlayerMoney, 1000 * 5);
if (resource == thisResource) {
setTimeout(function () {
sendResourceStartedSignalToServer();
}, 500);
garbageCollectorInterval = setInterval(collectAllGarbage, 1000 * 60);
localPlayerMoneyInterval = setInterval(updateLocalPlayerMoney, 1000 * 5);
sendResourceStartedSignalToServer();
}
}
@@ -84,11 +81,10 @@ function onResourceStop(event, resource) {
// ===========================================================================
function onResourceReady(event, resource) {
loadLocaleConfig();
setTimeout(function () {
if (resource == thisResource) {
loadLocaleConfig();
sendResourceReadySignalToServer();
}, 500);
}
}
// ===========================================================================