Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SEV 2] Layers File Fix for recent update #387

Open
wants to merge 2 commits into
base: 386-sev-2-layers-file-broken-on-recent-update
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 6 additions & 17 deletions squad-server/layers/layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,13 @@ export default class Layer {
};
this.teams = [];
for (const t of ['team1', 'team2']) {
let team = data[t] || data.teamConfigs[t];
this.teams.push({
faction: data[t].faction,
name: data[t].teamSetupName,
tickets: data[t].tickets,
commander: data[t].commander,
vehicles: (data[t].vehicles || []).map((vehicle) => ({
name: vehicle.type,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there some custom plugins that use this data still?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think dave's mapvote uses to show what the layer have as vehicles in the broadcast. But since the new layer list doesn't provide this info anymore we can't get that

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

best thing for custom plugins would be set it as empty array

classname: vehicle.rawType,
count: vehicle.count,
spawnDelay: vehicle.delay,
respawnDelay: vehicle.respawnTime
})),
numberOfTanks: (data[t].vehicles || []).filter((v) => {
return v.icon.match(/_tank/);
}).length,
numberOfHelicopters: (data[t].vehicles || []).filter((v) => {
return v.icon.match(/helo/);
}).length
faction: team.defaultFactionUnit,
name: team.defaultFactionUnit, // There is no other name presented in the data so in order to keep the same structure to support the old formatted codes, used the same name
tickets: team.tickets,
allowedFactionsUnitTypes: team.allowedFactionsUnitTypes,
allowedAlliances: team.allowedAlliances,
});
}
}
Expand Down