@adatechnology/game-destruction 0.8.0 → 0.8.2

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.
@@ -4158,13 +4158,14 @@ var GameDestruction = (() => {
4158
4158
  const crackLen = clamp2(0.03 + ratio * 0.2, 0.03, 0.8);
4159
4159
  let exitPoint;
4160
4160
  if (penetrated) {
4161
- exitPoint = vec.madd(entry, d, Math.min(pathLen, effM + layersThickness(p.layers, face) / slant + layersThickness(p.layers, -face) / slant));
4161
+ const exitDist = p.spec.contains || p.spec.fill !== void 0 && p.spec.fill < 0.5 || p.thickness < pathLen * 0.5 ? pathLen : Math.min(pathLen, effM + layersThickness(p.layers, face) / slant + layersThickness(p.layers, -face) / slant);
4162
+ exitPoint = vec.madd(entry, d, exitDist);
4162
4163
  const hole = addHole(o, p, entry, n, caliber / 1e3 * (mat.ductility >= 0.3 ? 1 : 1.5), true, exitPoint, src);
4163
4164
  if (p.layers.length > 0) spallOuter(o, p, exitPoint, -face, vec.scale(n, -1), Math.max(0.03, caliber / 1e3 * 4), src);
4164
4165
  addBreach(o, p, entry, Math.PI * (hole.diameter / 2) * (hole.diameter / 2), E, d, src);
4165
4166
  if (mat.ductility >= 0.5 && p.thickness <= THIN_SHEET_DISHING) addDent(o, p, entry, n, Math.max(caliber * 3 / 1e3, 0.012), clamp2(E * 2e-5, 1e-3, 0.03), src);
4166
4167
  if (brittle && mat.fracture === "shatter") addCrack(o, p, entry, n, crackLen, src);
4167
- if (p.spec.contains && (p.st.liters ?? 0) > 0) {
4168
+ if (p.spec.contains && (p.st.liters ?? 0) > 1e-4) {
4168
4169
  emit({
4169
4170
  ...base(o, src),
4170
4171
  type: "leak",