mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
This allows unique identification across saves. The front-end needs to be able to differentiate the first carrier in game A and the first carrier in game B, but because carriers (and other non-airfield CPs) are assigned IDs sequentially, collisions were to be expected. The front-end can't tell the difference between a reloaded game and a new turn, so we need to ensure different IDs across games. This is a handy cleanup anyway, since callers constructing CPs no longer need to manually track the CP ID counter. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2078.
18 lines
558 B
TypeScript
18 lines
558 B
TypeScript
import { selectControlPoints } from "../../api/controlPointsSlice";
|
|
import { useAppSelector } from "../../app/hooks";
|
|
import ControlPoint from "../controlpoints";
|
|
import { LayerGroup } from "react-leaflet";
|
|
|
|
export default function ControlPointsLayer() {
|
|
const controlPoints = useAppSelector(selectControlPoints);
|
|
return (
|
|
<LayerGroup>
|
|
{Object.values(controlPoints.controlPoints).map((controlPoint) => {
|
|
return (
|
|
<ControlPoint key={controlPoint.id} controlPoint={controlPoint} />
|
|
);
|
|
})}
|
|
</LayerGroup>
|
|
);
|
|
}
|