Fixes for new IV sync

This commit is contained in:
Vortrex
2022-11-07 13:35:49 -06:00
parent 01ba414e9c
commit 2aefa09340
8 changed files with 37 additions and 38 deletions

View File

@@ -338,15 +338,11 @@ function spawnAllVehicles() {
* @return {VehicleData} The vehicles's data (class instance)
*/
function getVehicleData(vehicle) {
if (getGame() != AGRP_GAME_GTA_IV) {
if (isVehicleObject(vehicle)) {
let dataIndex = getEntityData(vehicle, "agrp.dataSlot");
if (typeof getServerData().vehicles[dataIndex] != "undefined") {
return getServerData().vehicles[dataIndex];
}
if (isVehicleObject(vehicle)) {
let dataIndex = getEntityData(vehicle, "agrp.dataSlot");
if (typeof getServerData().vehicles[dataIndex] != "undefined") {
return getServerData().vehicles[dataIndex];
}
} else {
return getServerData().vehicles.find((v) => v.ivNetworkId == vehicle);
}
return false;