Apply suggestions
continuous-integration/drone/push Build is passing Details

pull/113/head
maxime.batista 1 year ago
parent 1043207e2d
commit 2a5de88380

@ -94,17 +94,27 @@ export function computePhantomPositioning(
const segments = action.segments const segments = action.segments
const lastSegment = segments[segments.length - 1] const lastSegment = segments[segments.length - 1]
const lastSegmentStart = segments[segments.length - 2]?.next const lastSegmentStart = segments[segments.length - 2]?.next
const pivotPoint = let pivotPoint = lastSegment.controlPoint
lastSegment.controlPoint ??
(lastSegmentStart if (!pivotPoint) {
? typeof lastSegmentStart === "string" if (lastSegmentStart) {
pivotPoint =
typeof lastSegmentStart === "string"
? document ? document
.getElementById(lastSegmentStart)! .getElementById(lastSegmentStart)!
.getBoundingClientRect() .getBoundingClientRect()
: lastSegmentStart : lastSegmentStart
: playerBeforePhantom.type === "phantom" } else {
? computePhantomPositioning(playerBeforePhantom, content, area) pivotPoint =
: playerBeforePhantom.pos) playerBeforePhantom.type === "phantom"
? computePhantomPositioning(
playerBeforePhantom,
content,
area,
)
: playerBeforePhantom.pos
}
}
const segment = posWithinBase(relativeTo(referentPos, pivotPoint), area) const segment = posWithinBase(relativeTo(referentPos, pivotPoint), area)
const segmentLength = norm(segment) const segmentLength = norm(segment)

@ -10,10 +10,6 @@ export enum PlayerTeam {
Opponents = "opponents", Opponents = "opponents",
} }
export interface Player extends PlayerInfo, Component<"player", Pos> {
readonly id: PlayerId
}
/** /**
* All information about a player * All information about a player
*/ */

Loading…
Cancel
Save