evtl fix expired object

This commit is contained in:
hydrant
2021-05-09 23:37:40 +02:00
parent 67976f55fe
commit b9c21a8e7e

View File

@@ -4,6 +4,7 @@ import game from "../..";
class RageEntity implements IEntity { class RageEntity implements IEntity {
private entity: EntityMp; private entity: EntityMp;
private entityType: string;
public __attachments: any[]; public __attachments: any[];
public __attachmentObjects: any[]; public __attachmentObjects: any[];
@@ -16,7 +17,7 @@ class RageEntity implements IEntity {
} }
exists() { exists() {
switch (this.entity.type) { switch (this.entityType) {
case "player": case "player":
return mp.players.exists(this.entity as PlayerMp); return mp.players.exists(this.entity as PlayerMp);
case "vehicle": case "vehicle":
@@ -45,6 +46,7 @@ class RageEntity implements IEntity {
constructor(entity: EntityMp) { constructor(entity: EntityMp) {
this.entity = entity; this.entity = entity;
this.entityType = this.entity.type;
} }
get type(): EntityType { get type(): EntityType {