Fix job blip bug + optimizations

This commit is contained in:
Vortrex
2022-06-07 10:27:15 -05:00
parent 6c979f6971
commit 3f64e60f33

View File

@@ -643,7 +643,7 @@ function stopWorking(client) {
sendPlayerStopJobRoute(client); sendPlayerStopJobRoute(client);
let jobId = getPlayerJob(client); let jobId = getPlayerJob(client);
messageDiscordEventChannel(`💼 ${getPlayerName(client)} has stopped working as a ${getJobData(jobId).name}`); messageDiscordEventChannel(`💼 ${getCharacterFullName(client)} has stopped working as a ${getJobData(jobId).name}`);
switch (getJobType(jobId)) { switch (getJobType(jobId)) {
case VRR_JOB_POLICE: case VRR_JOB_POLICE:
@@ -2381,6 +2381,10 @@ function createJobLocationPickup(jobId, locationId) {
return false; return false;
} }
if (!isGameFeatureSupported("pickups")) {
return false;
}
let tempJobData = getJobData(jobId); let tempJobData = getJobData(jobId);
if (tempJobData.pickupModel != -1) { if (tempJobData.pickupModel != -1) {
@@ -2418,6 +2422,10 @@ function createJobLocationBlip(jobId, locationId) {
return false; return false;
} }
if (!isGameFeatureSupported("blips")) {
return false;
}
let tempJobData = getJobData(jobId); let tempJobData = getJobData(jobId);
if (getJobData(jobId).blipModel == -1) { if (getJobData(jobId).blipModel == -1) {
@@ -2438,8 +2446,8 @@ function createJobLocationBlip(jobId, locationId) {
if (getGlobalConfig().jobBlipStreamInDistance == -1 || getGlobalConfig().jobBlipStreamOutDistance == -1) { if (getGlobalConfig().jobBlipStreamInDistance == -1 || getGlobalConfig().jobBlipStreamOutDistance == -1) {
blip.netFlags.distanceStreaming = false; blip.netFlags.distanceStreaming = false;
} else { } else {
setElementStreamInDistance(getServerData().jobs[i].locations[j].blip, getGlobalConfig().jobBlipStreamInDistance); setElementStreamInDistance(blip, getGlobalConfig().jobBlipStreamInDistance);
setElementStreamOutDistance(getServerData().jobs[i].locations[j].blip, getGlobalConfig().jobBlipStreamOutDistance); setElementStreamOutDistance(blip, getGlobalConfig().jobBlipStreamOutDistance);
} }
setElementOnAllDimensions(blip, false); setElementOnAllDimensions(blip, false);