Fix send biz labels to client
This commit is contained in:
@@ -769,11 +769,20 @@ function doesBusinessHaveInterior(businessId) {
|
|||||||
|
|
||||||
function sendAllBusinessLabelsToPlayer(client) {
|
function sendAllBusinessLabelsToPlayer(client) {
|
||||||
let tempBusinessLabels = [];
|
let tempBusinessLabels = [];
|
||||||
for(let i in getServerData().businesses) {
|
let totalBusinesses = getServerData().businesses.length;
|
||||||
tempBusinessLabels.push([i, getServerData().businesses[i].entrancePosition, getGameConfig().propertyLabelHeight[getServerGame()], getServerData().businesses[i].name, getServerData().businesses[i].locked, false]);
|
let businessesPerNetworkEvent = 100;
|
||||||
|
let totalNetworkEvents = Math.ceil(totalBusinesses/businessesPerNetworkEvent);
|
||||||
|
for(let i = 0 ; i < totalNetworkEvents ; i++) {
|
||||||
|
for(let j = 0 ; j < businessesPerNetworkEvent ; j++) {
|
||||||
|
let tempBusinessId = (i*businessesPerNetworkEvent)+j;
|
||||||
|
if(typeof getServerData().businesses[tempBusinessId] != "undefined") {
|
||||||
|
let tempBusinessLabels = [];
|
||||||
|
tempBusinessLabels.push([tempBusinessId, getServerData().businesses[tempBusinessId].entrancePosition, getGameConfig().propertyLabelHeight[getServerGame()], getServerData().businesses[tempBusinessId].description, getServerData().businesses[tempBusinessId].locked, false]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
triggerNetworkEvent("ag.bizlabel.all", client, tempBusinessLabels);
|
||||||
|
tempBusinessLabels = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
triggerNetworkEvent("ag.bizlabel.all", client, tempBusinessLabels);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user