Use hide route location util
This commit is contained in:
@@ -57,7 +57,8 @@ function setLocalPlayerWorkingState(tempWorking) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function showJobRouteLocation(position, colour) {
|
function showJobRouteLocation(position, colour) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Showing job route location`);
|
logToConsole(LOG_DEBUG, `[VRR.Job] Showing job route location at ${position.x}, ${position.y}, ${position.z}`);
|
||||||
|
hideJobRouteLocation();
|
||||||
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
if (getMultiplayerMod() == AGRP_MPMOD_GTAC) {
|
||||||
if (getGame() == AGRP_GAME_GTA_SA) {
|
if (getGame() == AGRP_GAME_GTA_SA) {
|
||||||
// Server-side spheres don't show in GTA SA for some reason.
|
// Server-side spheres don't show in GTA SA for some reason.
|
||||||
@@ -81,21 +82,7 @@ function showJobRouteLocation(position, colour) {
|
|||||||
|
|
||||||
function enteredJobRouteSphere() {
|
function enteredJobRouteSphere() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Job] Entered job route sphere`);
|
logToConsole(LOG_DEBUG, `[VRR.Job] Entered job route sphere`);
|
||||||
|
hideJobRouteLocation();
|
||||||
clearInterval(jobBlipBlinkTimer);
|
|
||||||
jobBlipBlinkAmount = 0;
|
|
||||||
jobBlipBlinkTimes = 0;
|
|
||||||
|
|
||||||
if (jobRouteLocationBlip != null) {
|
|
||||||
destroyElement(jobRouteLocationBlip);
|
|
||||||
jobRouteLocationBlip = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (jobRouteLocationSphere != null) {
|
|
||||||
destroyElement(jobRouteLocationSphere);
|
|
||||||
jobRouteLocationSphere = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
tellServerPlayerArrivedAtJobRouteLocation();
|
tellServerPlayerArrivedAtJobRouteLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,10 +115,24 @@ function blinkJobRouteLocationBlip(times, position, colour) {
|
|||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function hideJobRouteLocation() {
|
function hideJobRouteLocation() {
|
||||||
destroyElement(jobRouteLocationSphere);
|
logToConsole(LOG_DEBUG, `[VRR.Job] Hiding job route location`);
|
||||||
destroyElement(jobRouteLocationBlip);
|
|
||||||
jobRouteLocationSphere = null;
|
if (jobRouteLocationBlip != null) {
|
||||||
jobRouteLocationBlip = null;
|
destroyElement(jobRouteLocationBlip);
|
||||||
|
jobRouteLocationBlip = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jobRouteLocationSphere != null) {
|
||||||
|
destroyElement(jobRouteLocationSphere);
|
||||||
|
jobRouteLocationSphere = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jobBlipBlinkTimer != null) {
|
||||||
|
clearInterval(jobBlipBlinkTimer);
|
||||||
|
}
|
||||||
|
|
||||||
|
jobBlipBlinkAmount = 0;
|
||||||
|
jobBlipBlinkTimes = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user