1.9
This commit is contained in:
parent
fc7c94bd69
commit
2cc2f003df
71 changed files with 3359 additions and 1027 deletions
|
|
@ -5,10 +5,10 @@
|
|||
// of placement blocking. Render and actual placement both delegate here so a
|
||||
// green preview means the same footprint the click will try to place.
|
||||
(function (global) {
|
||||
function num(v, fallback = 0) {
|
||||
const num = global.TarinaiCoreHelpers?.finiteOr || ((v, fallback = 0) => {
|
||||
const n = Number(v);
|
||||
return Number.isFinite(n) ? n : fallback;
|
||||
}
|
||||
});
|
||||
function itemRadius(type, fallback = 12) {
|
||||
return global.itemRadiusFor(type, fallback);
|
||||
}
|
||||
|
|
@ -181,8 +181,10 @@
|
|||
}
|
||||
if (item.type === "rain_shelter") {
|
||||
const footprint = global.TarinaiParasolSystem?.parasolFootprint?.(item) || null;
|
||||
if (footprint) return { shape: "ellipse", centerX: footprint.centerX, centerY: footprint.centerY, radiusX: footprint.radiusX, radiusY: footprint.radiusY };
|
||||
if (footprint) return { shape: "roundedRect", centerX: footprint.centerX, centerY: footprint.centerY, halfWidth: footprint.radiusX, halfHeight: footprint.radiusY, cornerRadius: Math.max(8, Math.min(18, footprint.radiusY * 0.32)) };
|
||||
}
|
||||
const def = global.toolDefinition?.(item.type) || null;
|
||||
if (def?.collisionShape === "circle") return { shape: "circle", centerX: num(item.x), centerY: num(item.y), radius: Math.max(8, num(item.r, itemRadius(item.type, 12))) };
|
||||
return null;
|
||||
}
|
||||
function geometryFor(worldRef, item) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue