Use exterior business entrance for closest job point
This commit is contained in:
@@ -1521,3 +1521,21 @@ function updateHousePickupLabelData(houseId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function deleteAllHouseBlips() {
|
||||||
|
for(let i in getServerData().houses) {
|
||||||
|
deleteHouseEntranceBlip(i);
|
||||||
|
deleteHouseExitBlip(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
|
function deleteAllHousePickups() {
|
||||||
|
for(let i in getServerData().houses) {
|
||||||
|
deleteHouseEntrancePickup(i);
|
||||||
|
deleteHouseExitPickup(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
@@ -2635,8 +2635,6 @@ function createJobRouteLocationCommand(command, params, client) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!isPlayerOnJobRoute(client)) {
|
if(!isPlayerOnJobRoute(client)) {
|
||||||
messagePlayerError(client, getLocaleString(client, "NeedToBeOnJobRoute", "{ALTCOLOUR}/startroute{MAINCOLOUR}"));
|
messagePlayerError(client, getLocaleString(client, "NeedToBeOnJobRoute", "{ALTCOLOUR}/startroute{MAINCOLOUR}"));
|
||||||
return false;
|
return false;
|
||||||
@@ -2843,9 +2841,17 @@ function getClosestJobLocation(position) {
|
|||||||
let closestJobLocation = false;
|
let closestJobLocation = false;
|
||||||
for(let i in getServerData().jobs) {
|
for(let i in getServerData().jobs) {
|
||||||
for(let j in getServerData().jobs[i].locations) {
|
for(let j in getServerData().jobs[i].locations) {
|
||||||
if(!closestJobLocation || getServerData().jobs[i].locations[j].position.distance(position) < closestJobLocation.position.distance(position)) {
|
if(getServerData().jobs[i].locations[j].interior != getGameConfig().mainWorldInterior[getGame()] || getServerData().jobs[i].locations[j].dimension != getGameConfig().mainWorldDimension[getGame()]) {
|
||||||
closestJobLocation = getServerData().jobs[i].locations[j];
|
let businessId = getBusinessFromInteriorAndDimension(getServerData().jobs[i].locations[j].dimension, getServerData().jobs[i].locations[j].interior);
|
||||||
|
if(getBusinessData(businessId) != false) {
|
||||||
|
position = getBusinessData(businessId).entrancePosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!closestJobLocation || getServerData().jobs[i].locations[j].position.distance(position) < closestJobLocation.position.distance(position)) {
|
||||||
|
closestJobLocation = getServerData().jobs[i].locations[j];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return closestJobLocation;
|
return closestJobLocation;
|
||||||
|
|||||||
Reference in New Issue
Block a user