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 lastSegment = segments[segments.length - 1]
const lastSegmentStart = segments[segments.length - 2]?.next
const pivotPoint =
lastSegment.controlPoint ??
(lastSegmentStart
? typeof lastSegmentStart === "string"
let pivotPoint = lastSegment.controlPoint
if (!pivotPoint) {
if (lastSegmentStart) {
pivotPoint =
typeof lastSegmentStart === "string"
? document
.getElementById(lastSegmentStart)!
.getBoundingClientRect()
: lastSegmentStart
: playerBeforePhantom.type === "phantom"
? computePhantomPositioning(playerBeforePhantom, content, area)
: playerBeforePhantom.pos)
} else {
pivotPoint =
playerBeforePhantom.type === "phantom"
? computePhantomPositioning(
playerBeforePhantom,
content,
area,
)
: playerBeforePhantom.pos
}
}
const segment = posWithinBase(relativeTo(referentPos, pivotPoint), area)
const segmentLength = norm(segment)

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

Loading…
Cancel
Save