@adatechnology/game-crowd-three 0.5.4 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,6 +38,7 @@ var GameCrowdThree = (() => {
38
38
 
39
39
  // ../game-contracts/dist/index.js
40
40
  var DEFAULT_BLAST_SHOVE = { coupling: 0.02, maxSpeed: 20, lift: 0.3, minSpeed: 0.3, falloffPower: 2 };
41
+ var clampShare = (share) => Math.min(1, Math.max(0, share));
41
42
  function blastShove(blast, target, options = {}) {
42
43
  const o = { ...DEFAULT_BLAST_SHOVE, ...options };
43
44
  const dx = target.position[0] - blast.point[0];
@@ -47,7 +48,8 @@ var GameCrowdThree = (() => {
47
48
  if (!(blast.radius > 0) || distance2 > blast.radius) return void 0;
48
49
  const falloff = (1 - distance2 / blast.radius) ** o.falloffPower;
49
50
  const mass = Math.max(target.mass, 0.05);
50
- const speed = Math.min(o.maxSpeed, Math.sqrt(2 * blast.energy * (blast.reach ?? 1) * o.coupling / mass)) * falloff;
51
+ const reach = clampShare(blast.reach ?? 1);
52
+ const speed = Math.sqrt(reach) * Math.min(o.maxSpeed, Math.sqrt(2 * blast.energy * o.coupling / mass)) * falloff;
51
53
  if (!(speed >= o.minSpeed)) return void 0;
52
54
  const direction = distance2 > 1e-4 ? [dx / distance2, dy / distance2 + o.lift, dz / distance2] : [0, 1, 0];
53
55
  const length = Math.hypot(direction[0], direction[1], direction[2]);
@@ -150,6 +152,8 @@ var GameCrowdThree = (() => {
150
152
  mortar: "concrete",
151
153
  stone: "concrete",
152
154
  brick: "concrete",
155
+ cobble: "concrete",
156
+ paver: "concrete",
153
157
  plaster: "concrete",
154
158
  asphalt: "asphalt",
155
159
  wood_soft: "wood",
@@ -160,6 +164,8 @@ var GameCrowdThree = (() => {
160
164
  ceramic: "tile",
161
165
  plastic: "tile",
162
166
  soil: "dirt",
167
+ mud: "dirt",
168
+ clay: "dirt",
163
169
  wax: "dirt",
164
170
  flesh_fruit: "dirt",
165
171
  turf: "grass",
@@ -167,6 +173,8 @@ var GameCrowdThree = (() => {
167
173
  cactus: "grass",
168
174
  gravel: "gravel",
169
175
  sand: "sand",
176
+ // no snow surface yet: packed snow crunches closest to sand underfoot
177
+ snow: "sand",
170
178
  steel: "metal",
171
179
  cast_iron: "metal",
172
180
  aluminium: "metal",
@@ -1512,7 +1520,7 @@ var GameCrowdThree = (() => {
1512
1520
  var POSE_CLIPS = pose_clips_default.clips;
1513
1521
  var POSE_CLIP_LOCALES = pose_clips_default.locales;
1514
1522
 
1515
- // ../game-audio/dist/chunk-BXUGSOPY.js
1523
+ // ../game-audio/dist/chunk-C2K7XN2K.js
1516
1524
  var DISTANCE_CURVES = {
1517
1525
  /** The game's `sfx`: `vol / (1 + d² × 0.004)`, cutoff `/ (1 + d × 0.01)`, silent below 0.01 (jogo L62091–62092, L62101). */
1518
1526
  game_sfx: { model: "inverse_square", k: 4e-3, cutoffK: 0.01, minGain: 0.01 },
@@ -1947,6 +1955,7 @@ var GameCrowdThree = (() => {
1947
1955
  burst: 20,
1948
1956
  burstSpacing: 0.06
1949
1957
  };
1958
+ var CATALOG = new Map([...SFX_CATALOG, ...SFX_IMPACTS].map((entry) => [entry.id, entry]));
1950
1959
  var PT = {
1951
1960
  group: "Som",
1952
1961
  name: "Painel de som (arquivos e C1\u2013C10)",
@@ -2021,9 +2030,9 @@ var GameCrowdThree = (() => {
2021
2030
  strengths: { light: "leve", medium: "m\xE9dio", heavy: "forte" },
2022
2031
  states: { file: "A", synth: "S", missing: "F" },
2023
2032
  criteria: { C1: "C1 Sincronia", C2: "C2 Certo p/ a\xE7\xE3o", C3: "C3 Dist\xE2ncia", C4: "C4 Posi\xE7\xE3o", C5: "C5 Varia\xE7\xE3o", C6: "C6 Volume", C7: "C7 Intensidade", C8: "C8 Cauda", C9: "C9 Rajada", C10: "C10 Escuta" },
2024
- metrics: { source: "1 \xB7 Fonte do que tocou", chosen: "1 \xB7 Escolhido", matrix: "2 \xB7 Matriz", last: "\xDAltimo tocado", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Prefer\xEAncias", state: "5 \xB7 Medi\xE7\xE3o", count: "1 \xB7 Cat\xE1logo" },
2033
+ metrics: { source: "1 \xB7 Fonte do que tocou", chosen: "1 \xB7 Escolhido", matrix: "2 \xB7 Matriz", last: "\xDAltimo tocado", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Prefer\xEAncias", state: "5 \xB7 Medi\xE7\xE3o", count: "1 \xB7 Cat\xE1logo", unlicensed: "1 \xB7 Arquivo sem licen\xE7a" },
2025
2034
  run: { idle: "parada", measuring: "medindo\u2026", done: "pronta", failed: "falhou", recording: "gravando\u2026", recorded: "grava\xE7\xE3o baixada" },
2026
- words: { none: "\u2014", hidden: "? (revele)", prefers: "prefere", approved: "aprovado pelo dono" },
2035
+ words: { none: "\u2014", hidden: "? (revele)", prefers: "prefere", approved: "aprovado pelo dono", local_file: "arquivo do pacote local", sdk_file: "grava\xE7\xE3o do SDK", synth: "s\xEDntese do SDK" },
2027
2036
  sources: { sdk: "SDK", user: "seu som", synth: "sintetizado" },
2028
2037
  probe: "Fonte do som",
2029
2038
  wall: "Parede (oclus\xE3o)",
@@ -2094,9 +2103,9 @@ var GameCrowdThree = (() => {
2094
2103
  environments: { indoor: "indoor", outdoor: "outdoor" },
2095
2104
  strengths: { light: "light", medium: "medium", heavy: "heavy" },
2096
2105
  criteria: { C1: "C1 Sync", C2: "C2 Right sound", C3: "C3 Distance", C4: "C4 Position", C5: "C5 Variation", C6: "C6 Level", C7: "C7 Strength", C8: "C8 Tail", C9: "C9 Burst", C10: "C10 Listening" },
2097
- metrics: { source: "1 \xB7 Source of what played", chosen: "1 \xB7 Chosen", matrix: "2 \xB7 Matrix", last: "Last played", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Preferences", state: "5 \xB7 Measurement", count: "1 \xB7 Catalogue" },
2106
+ metrics: { source: "1 \xB7 Source of what played", chosen: "1 \xB7 Chosen", matrix: "2 \xB7 Matrix", last: "Last played", ab: "4 \xB7 A \xD7 B", blind: "4 \xB7 X", verdicts: "4 \xB7 Preferences", state: "5 \xB7 Measurement", count: "1 \xB7 Catalogue", unlicensed: "1 \xB7 File without licence" },
2098
2107
  run: { idle: "idle", measuring: "measuring\u2026", done: "done", failed: "failed", recording: "recording\u2026", recorded: "recording downloaded" },
2099
- words: { none: "\u2014", hidden: "? (reveal)", prefers: "prefers", approved: "approved by the owner" },
2108
+ words: { none: "\u2014", hidden: "? (reveal)", prefers: "prefers", approved: "approved by the owner", local_file: "local pack file", sdk_file: "SDK recording", synth: "SDK synthesis" },
2100
2109
  sources: { sdk: "SDK", user: "your sound", synth: "synthesized" },
2101
2110
  probe: "Sound source",
2102
2111
  wall: "Wall (occlusion)",
@@ -2179,6 +2188,66 @@ var GameCrowdThree = (() => {
2179
2188
  sources: [`cena:${line}`]
2180
2189
  };
2181
2190
  }
2191
+ var hz = (midi) => 440 * 2 ** ((midi - 69) / 12);
2192
+ var layer = (note, beat, wave, level) => {
2193
+ const [at, midi, beats] = note;
2194
+ const length = beats * beat;
2195
+ return {
2196
+ at: at * beat,
2197
+ duration: length,
2198
+ source: { kind: "osc", wave, frequency: { set: hz(midi) } },
2199
+ envelope: [[0, 1e-4, "set"], [0.01, level, "linear"], [Math.max(0.02, length * 0.9), level * 0.35, "linear"], [length, 1e-4, "exp", "fixed"]]
2200
+ };
2201
+ };
2202
+ function radioTrack(spec) {
2203
+ const beat = 60 / spec.bpm;
2204
+ const recipes = Array.from({ length: spec.bars }, (_, bar) => {
2205
+ const inBar = (notes) => notes.filter((n) => n[0] >= bar * 4 && n[0] < bar * 4 + 4).map((n) => [n[0] - bar * 4, n[1], n[2]]);
2206
+ const layers = [
2207
+ ...inBar(spec.bass).map((n) => layer(n, beat, "triangle", 0.16)),
2208
+ ...inBar(spec.chords).map((n) => layer(n, beat, "sine", 0.05)),
2209
+ ...inBar(spec.melody).map((n) => layer(n, beat, spec.wave, 0.07))
2210
+ ];
2211
+ return { id: `${spec.id}_${bar}`, bus: "world", duration: 4 * beat, layers, falloff: { model: "none" } };
2212
+ });
2213
+ return { song: { id: spec.id, barSeconds: 4 * beat, bars: recipes.map((r) => r.id) }, recipes };
2214
+ }
2215
+ var chord = (bar, root, minor = false) => [[bar * 4, root, 4], [bar * 4, root + (minor ? 3 : 4), 4], [bar * 4, root + 7, 4]];
2216
+ var bassLine = (roots, pattern) => roots.flatMap((root, bar) => pattern.map((b) => [bar * 4 + b, root - 12, 0.9]));
2217
+ var TRACKS = [
2218
+ // a bright pop loop: I–V–vi–IV in C
2219
+ radioTrack({
2220
+ id: "radio_track_pop",
2221
+ bpm: 112,
2222
+ bars: 4,
2223
+ wave: "square",
2224
+ bass: bassLine([48, 55, 57, 53], [0, 1.5, 2, 3]),
2225
+ chords: [...chord(0, 60), ...chord(1, 55), ...chord(2, 57, true), ...chord(3, 53)],
2226
+ melody: [[0, 76, 1], [1, 74, 0.5], [1.5, 72, 1.5], [4, 74, 1], [5, 76, 1], [6, 79, 2], [8, 76, 1], [9, 74, 1], [10, 72, 2], [12, 72, 1], [13, 74, 1], [14, 72, 2]]
2227
+ }),
2228
+ // a syncopated loop in A minor, the bass on the off-beats
2229
+ radioTrack({
2230
+ id: "radio_track_groove",
2231
+ bpm: 100,
2232
+ bars: 4,
2233
+ wave: "triangle",
2234
+ bass: bassLine([57, 62, 64, 57], [0, 0.75, 1.5, 2.5, 3.25]),
2235
+ chords: [...chord(0, 57, true), ...chord(1, 62, true), ...chord(2, 64), ...chord(3, 57, true)],
2236
+ melody: [[0.5, 72, 0.5], [1.25, 76, 0.75], [2.5, 74, 1], [4.5, 77, 0.5], [5.25, 74, 0.75], [6.5, 72, 1.5], [8.5, 71, 0.5], [9.25, 74, 0.75], [10.5, 76, 1.5], [12.5, 72, 0.5], [13.25, 69, 2]]
2237
+ }),
2238
+ // a slow blues-like loop in F with a swung melody
2239
+ radioTrack({
2240
+ id: "radio_track_slow",
2241
+ bpm: 76,
2242
+ bars: 4,
2243
+ wave: "sine",
2244
+ bass: bassLine([53, 58, 53, 60], [0, 2]),
2245
+ chords: [...chord(0, 65), ...chord(1, 58), ...chord(2, 65), ...chord(3, 60)],
2246
+ melody: [[0, 72, 1.5], [1.67, 75, 0.33], [2, 77, 2], [4, 74, 1], [5, 72, 1], [6, 70, 2], [8, 72, 1.5], [9.67, 69, 0.33], [10, 65, 2], [12, 67, 1], [13, 70, 1], [14, 72, 2]]
2247
+ })
2248
+ ];
2249
+ var RADIO_TRACKS = TRACKS.map((t) => t.song);
2250
+ var RADIO_BANK = { id: "vehicle_radio", sounds: TRACKS.flatMap((t) => t.recipes), loops: [] };
2182
2251
  var FOLEY_FALLOFF = {
2183
2252
  model: "inverse_square",
2184
2253
  k: 0.02,
@@ -2785,11 +2854,11 @@ var GameCrowdThree = (() => {
2785
2854
  ...s.splash ? [sceneNoise({ type: "bandpass", f: s.splash.f * take.f, f2: s.splash.f2 * take.f, q: 1.4, d: s.splash.d * take.t * weight ** 0.4, vol: s.splash.vol * gait.vol * take.v * weight ** 0.5 })] : []
2786
2855
  ];
2787
2856
  }
2788
- var quieter = (level, layers) => layers.map((layer) => {
2789
- const gain = layer.gain ?? 1;
2790
- if (typeof gain === "number") return { ...layer, gain: gain * level };
2791
- if (Array.isArray(gain)) return { ...layer, gain: [gain[0] * level, gain[1] * level] };
2792
- return layer;
2857
+ var quieter = (level, layers) => layers.map((layer2) => {
2858
+ const gain = layer2.gain ?? 1;
2859
+ if (typeof gain === "number") return { ...layer2, gain: gain * level };
2860
+ if (Array.isArray(gain)) return { ...layer2, gain: [gain[0] * level, gain[1] * level] };
2861
+ return layer2;
2793
2862
  });
2794
2863
  var recipe = (id, layers, falloff, bus = "world") => ({ id, bus, pan: true, layers, falloff, sources: ["sdk"] });
2795
2864
  var takeId = (id, index) => `${id}_${String(index + 1).padStart(2, "0")}`;
@@ -2805,7 +2874,7 @@ var GameCrowdThree = (() => {
2805
2874
  (take) => quieter(LANDING_LEVEL, [
2806
2875
  // both feet, a hair apart, then the knees taking the weight (a low body thump) and the clothes settling
2807
2876
  ...footLayers(surface, take, GAITS.run, LANDINGS[landing2].weight),
2808
- ...footLayers(surface, { ...take, v: take.v * 0.6 }, GAITS.run, LANDINGS[landing2].weight * 0.6).map((layer) => ({ ...layer, at: (typeof layer.at === "number" ? layer.at : 0) + 0.018 * take.t })),
2877
+ ...footLayers(surface, { ...take, v: take.v * 0.6 }, GAITS.run, LANDINGS[landing2].weight * 0.6).map((layer2) => ({ ...layer2, at: (typeof layer2.at === "number" ? layer2.at : 0) + 0.018 * take.t })),
2809
2878
  sceneTone({ f: 60 * take.f, f2: 38, d: 0.14 * LANDINGS[landing2].weight * take.t, vol: 0.22 * LANDINGS[landing2].weight ** 0.7 * take.v, delay: 0.02 }),
2810
2879
  sceneNoise({ type: "bandpass", f: [1800, 2600], q: 0.8, d: 0.18, vol: LANDINGS[landing2].cloth * take.v, delay: 0.04 })
2811
2880
  ]),
@@ -2851,7 +2920,7 @@ var GameCrowdThree = (() => {
2851
2920
  fall_damage: (take) => [
2852
2921
  ...BODY.body_fall(take),
2853
2922
  sceneNoise({ type: "highpass", f: 2800, d: 0.02, vol: 0.35 * take.v, delay: 0.01 }),
2854
- ...voice({ f0: 170, f1: 110, d: 0.32, fA: 650, fB: 1150, noise: 0.25, vol: 0.32 })(take).map((layer) => ({ ...layer, at: 0.08 }))
2923
+ ...voice({ f0: 170, f1: 110, d: 0.32, fA: 650, fB: 1150, noise: 0.25, vol: 0.32 })(take).map((layer2) => ({ ...layer2, at: 0.08 }))
2855
2924
  ],
2856
2925
  player_hurt: voice({ f0: 150, f1: 105, d: 0.26, fA: 620, fB: 1100, noise: 0.3, vol: 0.35 }),
2857
2926
  player_breath_run: (take) => [
@@ -4062,8 +4131,8 @@ var GameCrowdThree = (() => {
4062
4131
  const face = faces[i];
4063
4132
  f3(face[2] + offset, face[1] + offset, face[0] + offset);
4064
4133
  }
4065
- const layer = steps + bevelSegments * 2;
4066
- offset = vlen * layer;
4134
+ const layer2 = steps + bevelSegments * 2;
4135
+ offset = vlen * layer2;
4067
4136
  for (let i = 0; i < flen; i++) {
4068
4137
  const face = faces[i];
4069
4138
  f3(face[0] + offset, face[1] + offset, face[2] + offset);
@@ -4510,7 +4579,7 @@ var GameCrowdThree = (() => {
4510
4579
  return releaseObject3D(list2, { keep });
4511
4580
  }
4512
4581
 
4513
- // ../game-characters-three/dist/chunk-XSMP7T6O.js
4582
+ // ../game-characters-three/dist/chunk-IBMIWGWX.js
4514
4583
  var UNDEAD_VOICE_GROUP = "undead_voice";
4515
4584
  var voiced = { bus: "voices", group: UNDEAD_VOICE_GROUP };
4516
4585
  var p = (param) => ({ param });
@@ -5641,7 +5710,7 @@ var GameCrowdThree = (() => {
5641
5710
  }
5642
5711
  }
5643
5712
  });
5644
- const layer = (bytes) => {
5713
+ const layer2 = (bytes) => {
5645
5714
  const texture2 = new three.DataTexture(bytes, stride, rows * cellHeight, three.RGBAFormat, three.UnsignedByteType);
5646
5715
  texture2.minFilter = three.NearestFilter;
5647
5716
  texture2.magFilter = three.NearestFilter;
@@ -5649,8 +5718,8 @@ var GameCrowdThree = (() => {
5649
5718
  texture2.needsUpdate = true;
5650
5719
  return texture2;
5651
5720
  };
5652
- const texture = layer(pixels);
5653
- const colorTexture = layer(colorPixels);
5721
+ const texture = layer2(pixels);
5722
+ const colorTexture = layer2(colorPixels);
5654
5723
  return { texture, colorTexture, silhouettes: bodies.length, cellWidth, cellHeight, columns, rows, boxes, pixels, colorPixels, dispose: () => (texture.dispose(), colorTexture.dispose()) };
5655
5724
  };
5656
5725
  var ACCESSORY_BIT = { CAP: 1, HELMET: 2, BACKPACK: 4, EXTRA: 8 };
@@ -7110,9 +7179,9 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
7110
7179
  for (let i = 0; i < view.n; i++) {
7111
7180
  if (!workspace.takesPart[i]) continue;
7112
7181
  const hx = Math.floor(store.x[i] + grid.half);
7113
- const hz = Math.floor(store.z[i] + grid.half);
7114
- if (hx < 0 || hz < 0 || hx >= side || hz >= side) continue;
7115
- const cell = hz * side + hx;
7182
+ const hz2 = Math.floor(store.z[i] + grid.half);
7183
+ if (hx < 0 || hz2 < 0 || hx >= side || hz2 >= side) continue;
7184
+ const cell = hz2 * side + hx;
7116
7185
  if (workspace.head[cell] === -1) workspace.touched[workspace.touchedCount++] = cell;
7117
7186
  workspace.next[i] = workspace.head[cell];
7118
7187
  workspace.head[cell] = i;
@@ -7144,12 +7213,12 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
7144
7213
  for (let i = 0; i < view.n; i++) {
7145
7214
  if (!workspace.takesPart[i]) continue;
7146
7215
  const hx = Math.floor(store.x[i] + grid.half);
7147
- const hz = Math.floor(store.z[i] + grid.half);
7148
- if (hx < 0 || hz < 0 || hx >= side || hz >= side) continue;
7149
- addPairsOfCell(view, i, hz * side + hx, true);
7216
+ const hz2 = Math.floor(store.z[i] + grid.half);
7217
+ if (hx < 0 || hz2 < 0 || hx >= side || hz2 >= side) continue;
7218
+ addPairsOfCell(view, i, hz2 * side + hx, true);
7150
7219
  for (let k = 0; k < FORWARD_CELLS.length; k += 2) {
7151
7220
  const qx = hx + FORWARD_CELLS[k];
7152
- const qz = hz + FORWARD_CELLS[k + 1];
7221
+ const qz = hz2 + FORWARD_CELLS[k + 1];
7153
7222
  if (qx >= 0 && qz >= 0 && qx < side && qz < side) addPairsOfCell(view, i, qz * side + qx, false);
7154
7223
  }
7155
7224
  }
@@ -8148,14 +8217,14 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
8148
8217
  const x = pool.x[slot];
8149
8218
  const z = pool.z[slot];
8150
8219
  const hx = Math.floor(x + grid.half);
8151
- const hz = Math.floor(z + grid.half);
8220
+ const hz2 = Math.floor(z + grid.half);
8152
8221
  const mass = massOf(slot);
8153
8222
  const speed = Math.hypot(pool.vx[slot], pool.vz[slot]);
8154
8223
  const reach = options.landingRadius * options.landingRadius;
8155
8224
  for (let oz = -1; oz <= 1; oz++)
8156
8225
  for (let ox = -1; ox <= 1; ox++) {
8157
- if (hx + ox < 0 || hz + oz < 0 || hx + ox >= side || hz + oz >= side) continue;
8158
- for (let j = contact.workspace.head[(hz + oz) * side + hx + ox]; j !== -1; j = contact.workspace.next[j]) {
8226
+ if (hx + ox < 0 || hz2 + oz < 0 || hx + ox >= side || hz2 + oz >= side) continue;
8227
+ for (let j = contact.workspace.head[(hz2 + oz) * side + hx + ox]; j !== -1; j = contact.workspace.next[j]) {
8159
8228
  const ex = store.x[j] - x;
8160
8229
  const ez = store.z[j] - z;
8161
8230
  if (j === pool.agent[slot] || ex * ex + ez * ez > reach || !takesPartInContact(store, j)) continue;
@@ -9367,9 +9436,9 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
9367
9436
  Z.attackTimer[i] -= tdt;
9368
9437
  if (Z.attackTimer[i] <= 0) {
9369
9438
  const hx = Math.floor(Z.x[i] + HALF);
9370
- const hz = Math.floor(Z.z[i] + HALF);
9371
- if (hx >= 0 && hz >= 0 && hx < HN && hz < HN)
9372
- for (let j = hHead[hz * HN + hx]; j !== -1; j = hNext[j]) {
9439
+ const hz2 = Math.floor(Z.z[i] + HALF);
9440
+ if (hx >= 0 && hz2 >= 0 && hx < HN && hz2 < HN)
9441
+ for (let j = hHead[hz2 * HN + hx]; j !== -1; j = hNext[j]) {
9373
9442
  if (j !== i && (Z.x[j] - Z.x[i]) ** 2 + (Z.z[j] - Z.z[i]) ** 2 < ss.hitRadius2) {
9374
9443
  Z.attackTimer[i] = N.attackEvery;
9375
9444
  hurtOther(j, C.damage);
@@ -9568,9 +9637,9 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
9568
9637
  for (let i = 0; i < Z.n; i++) {
9569
9638
  if (Z.band[i] !== 0 || engine.active && Z.balance[i] === BALANCE.THROWN) continue;
9570
9639
  const hx = Math.floor(Z.x[i] + HALF);
9571
- const hz = Math.floor(Z.z[i] + HALF);
9572
- if (hx < 0 || hz < 0 || hx >= HN || hz >= HN) continue;
9573
- const h = hz * HN + hx;
9640
+ const hz2 = Math.floor(Z.z[i] + HALF);
9641
+ if (hx < 0 || hz2 < 0 || hx >= HN || hz2 >= HN) continue;
9642
+ const h = hz2 * HN + hx;
9574
9643
  if (engine.active && hHead[h] === -1) hashTouched[hashTouchedN++] = h;
9575
9644
  hNext[i] = hHead[h];
9576
9645
  hHead[h] = i;
@@ -9732,11 +9801,11 @@ ${accessoryHead}`).replace("{ vec3 _nn = objectNormal; bodyAnim(position, _nn);"
9732
9801
  let sz = 0;
9733
9802
  if (b === 0) {
9734
9803
  const hx = Math.floor(Z.x[i] + HALF);
9735
- const hz = Math.floor(Z.z[i] + HALF);
9804
+ const hz2 = Math.floor(Z.z[i] + HALF);
9736
9805
  for (let oz = -1; oz <= 1; oz++)
9737
9806
  for (let ox = -1; ox <= 1; ox++) {
9738
9807
  const qx = hx + ox;
9739
- const qz = hz + oz;
9808
+ const qz = hz2 + oz;
9740
9809
  if (qx < 0 || qz < 0 || qx >= HN || qz >= HN) continue;
9741
9810
  for (let j = hHead[qz * HN + qx]; j !== -1; j = hNext[j]) {
9742
9811
  if (j === i || Z.state[j] === STATE.PILE_STEP || Z.state[j] === STATE.DORMANT || balanceOn && (Z.balance[j] === BALANCE.FALLEN || Z.balance[j] === BALANCE.GETTING_UP)) continue;