Attachment Sync: Fehlerbehebung bei Join
This commit is contained in:
@@ -8,7 +8,7 @@ class RageEntity implements IEntity {
|
|||||||
return this.entity.id;
|
return this.entity.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
get remoteId(): any {
|
get remoteId(): number {
|
||||||
return this.entity.remoteId;
|
return this.entity.remoteId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ interface IBrowser {
|
|||||||
|
|
||||||
interface IEntity {
|
interface IEntity {
|
||||||
id: number;
|
id: number;
|
||||||
remoteId: any;
|
remoteId: number;
|
||||||
type: EntityType;
|
type: EntityType;
|
||||||
getSharedData<T>(key: string): T;
|
getSharedData<T>(key: string): T;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -242,6 +242,11 @@ export default function attachmentManager(game: IGame) {
|
|||||||
function InitAttachmentsOnJoin() {
|
function InitAttachmentsOnJoin() {
|
||||||
game.players.forEach(_player => {
|
game.players.forEach(_player => {
|
||||||
let player = mp.players.at(_player.remoteId);
|
let player = mp.players.at(_player.remoteId);
|
||||||
|
|
||||||
|
if (!player) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let e = game.attachments.get(_player);
|
let e = game.attachments.get(_player);
|
||||||
if (e == null) {
|
if (e == null) {
|
||||||
let __attachments = [];
|
let __attachments = [];
|
||||||
@@ -259,6 +264,11 @@ export default function attachmentManager(game: IGame) {
|
|||||||
|
|
||||||
game.vehicles.forEach(_veh => {
|
game.vehicles.forEach(_veh => {
|
||||||
let vehicle = mp.vehicles.at(_veh.remoteId);
|
let vehicle = mp.vehicles.at(_veh.remoteId);
|
||||||
|
|
||||||
|
if (!vehicle) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let e = game.attachments.get(_veh);
|
let e = game.attachments.get(_veh);
|
||||||
if (e == null) {
|
if (e == null) {
|
||||||
let __attachments = [];
|
let __attachments = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user