mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +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 isHull = node.name.startsWith('hull_');
|
||||||
const armorId = parseInt(node.name.match(/.+_armor_(\d+)/)![1]);
|
const armorId = parseInt(node.name.match(/.+_armor_(\d+)/)![1]);
|
||||||
const isVisible = isHull;
|
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 (
|
return (
|
||||||
<ArmorMesh
|
<ArmorMesh
|
||||||
key={node.uuid}
|
key={node.uuid}
|
||||||
@@ -111,10 +111,9 @@ export function TankArmor() {
|
|||||||
);
|
);
|
||||||
const isVisible = isCurrentTurret;
|
const isVisible = isCurrentTurret;
|
||||||
const armorId = parseInt(node.name.match(/.+_armor_(\d+)/)![1]);
|
const armorId = parseInt(node.name.match(/.+_armor_(\d+)/)![1]);
|
||||||
const thickness =
|
const thickness = turretModelDefinition.armor.thickness[armorId];
|
||||||
turretModelDefinition.armor.thickness[armorId] ?? 0;
|
|
||||||
|
|
||||||
if (!isVisible) return null;
|
if (!isVisible || thickness === undefined) return null;
|
||||||
return (
|
return (
|
||||||
<ArmorMesh
|
<ArmorMesh
|
||||||
key={node.uuid}
|
key={node.uuid}
|
||||||
@@ -144,11 +143,9 @@ export function TankArmor() {
|
|||||||
);
|
);
|
||||||
const isVisible = isCurrentGun;
|
const isVisible = isCurrentGun;
|
||||||
const armorId = parseInt(node.name.match(/.+_armor_(\d+)/)![1]);
|
const armorId = parseInt(node.name.match(/.+_armor_(\d+)/)![1]);
|
||||||
const thickness =
|
const thickness = gunModelDefinition.armor.thickness[armorId];
|
||||||
gunModelDefinition.armor.thickness[armorId] ?? 0;
|
|
||||||
|
|
||||||
if (!isVisible) return null;
|
|
||||||
|
|
||||||
|
if (!isVisible || thickness === undefined) return null;
|
||||||
return (
|
return (
|
||||||
<ArmorMesh
|
<ArmorMesh
|
||||||
key={node.uuid}
|
key={node.uuid}
|
||||||
|
|||||||
Reference in new issue
Block a user