mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
fix: discard no armor thickness meshes
This commit is contained in:
1 parent
5e06a606ef
commit
9ccd183607
1 file changed
+6
-9
@@ -86,9 +86,9 @@ export function TankArmor() {
|
||||
const isHull = node.name.startsWith('hull_');
|
||||
const armorId = parseInt(node.name.match(/.+_armor_(\d+)/)![1]);
|
||||
const isVisible = isHull;
|
||||
const thickness = tankModelDefinition.armor.thickness[armorId] ?? 0;
|
||||
const thickness = tankModelDefinition.armor.thickness[armorId];
|
||||
|
||||
if (!isVisible) return null;
|
||||
if (!isVisible || thickness === undefined) return null;
|
||||
return (
|
||||
<ArmorMesh
|
||||
key={node.uuid}
|
||||
@@ -111,10 +111,9 @@ export function TankArmor() {
|
||||
);
|
||||
const isVisible = isCurrentTurret;
|
||||
const armorId = parseInt(node.name.match(/.+_armor_(\d+)/)![1]);
|
||||
const thickness =
|
||||
turretModelDefinition.armor.thickness[armorId] ?? 0;
|
||||
const thickness = turretModelDefinition.armor.thickness[armorId];
|
||||
|
||||
if (!isVisible) return null;
|
||||
if (!isVisible || thickness === undefined) return null;
|
||||
return (
|
||||
<ArmorMesh
|
||||
key={node.uuid}
|
||||
@@ -144,11 +143,9 @@ export function TankArmor() {
|
||||
);
|
||||
const isVisible = isCurrentGun;
|
||||
const armorId = parseInt(node.name.match(/.+_armor_(\d+)/)![1]);
|
||||
const thickness =
|
||||
gunModelDefinition.armor.thickness[armorId] ?? 0;
|
||||
|
||||
if (!isVisible) return null;
|
||||
const thickness = gunModelDefinition.armor.thickness[armorId];
|
||||
|
||||
if (!isVisible || thickness === undefined) return null;
|
||||
return (
|
||||
<ArmorMesh
|
||||
key={node.uuid}
|
||||
|
||||
Reference in new issue
Block a user