Skip to content
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