Use util to properly clear arrays

This commit is contained in:
Vortrex
2021-11-30 21:51:41 -06:00
parent 07a95f1560
commit 2e3b367a5f
3 changed files with 3 additions and 3 deletions

View File

@@ -1450,7 +1450,7 @@ function reloadAllBusinessesCommand(command, params, client) {
} }
//forceAllPlayersToStopWorking(); //forceAllPlayersToStopWorking();
getServerData().businesses = null; clearArray(getServerData().businesses);
getServerData().businesses = loadBusinessesFromDatabase(); getServerData().businesses = loadBusinessesFromDatabase();
createAllBusinessPickups(); createAllBusinessPickups();
createAllBusinessBlips(); createAllBusinessBlips();

View File

@@ -1184,7 +1184,7 @@ function reloadAllHousesCommand(command, params, client) {
deleteHouseEntrancePickup(i); deleteHouseEntrancePickup(i);
} }
getServerData().houses = null; clearArray(getServerData().houses);
getServerData().houses = loadHousesFromDatabase(); getServerData().houses = loadHousesFromDatabase();
createAllHousePickups(); createAllHousePickups();
createAllHouseBlips(); createAllHouseBlips();

View File

@@ -218,7 +218,7 @@ function getRadioStationData(radioStationId) {
function reloadAllRadioStationsCommand(command, params, client) { function reloadAllRadioStationsCommand(command, params, client) {
stopRadioStreamForPlayer(null); stopRadioStreamForPlayer(null);
getServerData().radioStations.splice(0, getServerData().radioStations.length-1); clearArray(getServerData().radioStations);
getServerData().radioStations = loadRadioStationsFromDatabase(); getServerData().radioStations = loadRadioStationsFromDatabase();
setRadioStationIndexes(); setRadioStationIndexes();