Skip to content

Commit

Permalink
fix objects getting cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
MineFact committed Jan 28, 2024
1 parent 617b35e commit 3f298f5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/struct/core/buildteam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export default class BuildTeam {
// Add servers to the build team info

if(servers == null)
info.Servers = this.network.buildTeamServers.filter((server: any) => server.BuildTeam == info.ID);
info.Servers = JSON.parse(JSON.stringify(this.network.buildTeamServers)).filter((server: any) => server.BuildTeam == info.ID);
else
info.Servers = servers;

Expand All @@ -209,25 +209,25 @@ export default class BuildTeam {

// Add regions to the build team info

info.Regions = this.network.buildTeamRegions.filter((region: any) => region.BuildTeam == info.ID);
info.Regions = JSON.parse(JSON.stringify(this.network.buildTeamRegions)).filter((region: any) => region.BuildTeam == info.ID);

for(const region of info.Regions)
region.BuildTeam = undefined;


// Add warps to the build team info

info.Warps = this.network.buildTeamWarps.filter((warp: any) => warp.BuildTeam == info.ID);
info.Warps = JSON.parse(JSON.stringify(this.network.buildTeamWarps)).filter((warp: any) => warp.BuildTeam == info.ID);

for(const warp of this.network.buildTeamWarps)
for(const warp of info.Warps)
warp.BuildTeam = undefined;


// Add warp groups to the build team info

info.WarpGroups = this.network.buildTeamWarpGroups.filter((warpGroup: any) => warpGroup.BuildTeam == info.ID);
info.WarpGroups = JSON.parse(JSON.stringify(this.network.buildTeamWarpGroups)).filter((warpGroup: any) => warpGroup.BuildTeam == info.ID);

for(const warpGroup of this.network.buildTeamWarpGroups)
for(const warpGroup of info.WarpGroups)
warpGroup.BuildTeam = undefined;


Expand Down

0 comments on commit 3f298f5

Please sign in to comment.