Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Commit

Permalink
fix: add bridge bounds to map gen check
Browse files Browse the repository at this point in the history
  • Loading branch information
leia-uwu committed Sep 14, 2024
1 parent c9eea99 commit db570a6
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions server/src/game/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ function computeColliders(type: string) {
}
case "structure": {
if (def.mapObstacleBounds) {
for (let i = 0; i < def.mapObstacleBounds.length; i++) {
colliders.ground.push(...def.mapObstacleBounds);
}
colliders.ground.push(...def.mapObstacleBounds);
}

for (let i = 0; i < def.layers.length; i++) {
Expand Down Expand Up @@ -85,10 +83,23 @@ function computeColliders(type: string) {
}
}

if (def.bridgeLandBounds) {
for (let i = 0; i < def.bridgeLandBounds.length; i++) {
colliders.ground.push(def.bridgeLandBounds[i]);
}
}
if (def.bridgeWaterBounds) {
for (let i = 0; i < def.bridgeWaterBounds.length; i++) {
colliders.ground.push(def.bridgeWaterBounds[i]);
}
}

break;
}
case "building": {
if (def.mapObstacleBounds) colliders.ground.push(...def.mapObstacleBounds);
if (def.mapObstacleBounds) {
colliders.ground.push(...def.mapObstacleBounds);
}

for (const object of def.mapObjects ?? []) {
const type =
Expand Down Expand Up @@ -131,6 +142,18 @@ function computeColliders(type: string) {
colliders.ground.push(region.zoomOut);
}
}

if (def.bridgeLandBounds) {
for (let i = 0; i < def.bridgeLandBounds.length; i++) {
colliders.ground.push(def.bridgeLandBounds[i]);
}
}
if (def.bridgeWaterBounds) {
for (let i = 0; i < def.bridgeWaterBounds.length; i++) {
colliders.ground.push(def.bridgeWaterBounds[i]);
}
}

break;
}
case "loot_spawner": {
Expand Down

0 comments on commit db570a6

Please sign in to comment.