aaaaaaaaa

This commit is contained in:
hydrant
2020-07-29 21:54:25 +02:00
parent d4770c88ed
commit d88b4d8ebf
3 changed files with 28 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
import { IEntity, IPlayer, IEntityAttachments, IEntityAttachmentPool, IPlayerPool, IVehicle, IVehiclePool, VehicleSeat, EntityType } from "../../game";
import { parseJson } from "../../util";
import game from "../..";
class RageEntity implements IEntity {
private entity: EntityMp;
@@ -184,11 +185,22 @@ class RageVehicle extends RageEntity implements IVehicle {
class RageVehiclePool implements IVehiclePool {
at(id: number): IVehicle {
return new RageVehicle(mp.vehicles.atRemoteId(Number(id)));
var veh = mp.vehicles.atRemoteId(Number(id));
if (!veh) {
game.ui.sendChatMessage("pool.at - veh is null")
return null;
}
return new RageVehicle(veh);
}
forEach(fn: (entity: IVehicle) => void): void {
mp.vehicles.forEach(e => {
if (!e) {
game.ui.sendChatMessage("forEach - e is null");
return;
}
fn(new RageVehicle(e));
})
}