fix: dead code

This commit is contained in:
TrèsAbhi committed 2025-08-29 13:42:44 -05:00
1 parent c42e5b7dc3
commit b82e905757
23 files changed
+56 -137

No files matched your search

@@ -80,7 +80,7 @@ export function PrimaryArmorSceneComponent({
});
useEffect(() => {
async function handleShellChange() {
function handleShellChange() {
const duel = duelStore.getState();
const tankopediaEphemeral = tankopediaEphemeralStore.getState();
const shell = tankopediaEphemeral.customShell ?? duel.antagonist.shell;
@@ -97,14 +97,8 @@ export function PrimaryArmorSceneComponent({
material.uniforms.damage.value = shell.armor_damage;
material.uniforms.explosionRadius.value = shell.explosion_radius;
await handleProtagonistEquipmentChange(
duel.protagonist.equipmentMatrix,
true,
);
await handleAntagonistEquipmentChange(
duel.antagonist.equipmentMatrix,
true,
);
handleProtagonistEquipmentChange(duel.protagonist.equipmentMatrix, true);
handleAntagonistEquipmentChange(duel.antagonist.equipmentMatrix, true);
invalidate();
}
@@ -121,12 +115,12 @@ export function PrimaryArmorSceneComponent({
function handleWireframeChange(wireframe: boolean) {
material.wireframe = wireframe;
}
async function handleProtagonistEquipmentChange(
function handleProtagonistEquipmentChange(
equipment: EquipmentMatrix,
noInvalidate = false,
) {
const duel = duelStore.getState();
const hasEnhancedArmor = await hasEquipment(
const hasEnhancedArmor = hasEquipment(
110,
duel.protagonist.tank.equipment_preset,
equipment,
@@ -137,7 +131,7 @@ export function PrimaryArmorSceneComponent({
if (!noInvalidate) invalidate();
}
async function handleAntagonistEquipmentChange(
function handleAntagonistEquipmentChange(
equipment: EquipmentMatrix,
noInvalidate = false,
) {
@@ -145,7 +139,7 @@ export function PrimaryArmorSceneComponent({
const tankopediaEphemeral = tankopediaEphemeralStore.getState();
const shell = tankopediaEphemeral.customShell ?? duel.antagonist.shell;
const penetration = shell.penetration.near;
const hasCalibratedShells = await hasEquipment(
const hasCalibratedShells = hasEquipment(
103,
duel.antagonist.tank.equipment_preset,
equipment,
@@ -54,11 +54,9 @@ export function SpacedArmorSubExternal({
const shell = tankopediaEphemeral.customShell ?? duel.antagonist.shell;
material.uniforms.penetration.value = shell.penetration.near;
}
async function handleProtagonistEquipmentChange(
equipment: EquipmentMatrix,
) {
function handleProtagonistEquipmentChange(equipment: EquipmentMatrix) {
const duel = duelStore.getState();
const hasEnhancedArmor = await hasEquipment(
const hasEnhancedArmor = hasEquipment(
110,
duel.protagonist.tank.equipment_preset,
equipment,
@@ -67,12 +65,12 @@ export function SpacedArmorSubExternal({
? thickness * 1.03
: thickness;
}
async function handleAntagonistEquipmentChange(equipment: EquipmentMatrix) {
function handleAntagonistEquipmentChange(equipment: EquipmentMatrix) {
const duel = duelStore.getState();
const tankopediaEphemeral = tankopediaEphemeralStore.getState();
const shell = tankopediaEphemeral.customShell ?? duel.antagonist.shell;
const penetration = shell.penetration.near;
const hasCalibratedShells = await hasEquipment(
const hasCalibratedShells = hasEquipment(
103,
duel.antagonist.tank.equipment_preset,
equipment,
@@ -64,11 +64,9 @@ export function SpacedArmorSubSpaced({
shell.normalization ?? 0,
);
}
async function handleProtagonistEquipmentChange(
equipment: EquipmentMatrix,
) {
function handleProtagonistEquipmentChange(equipment: EquipmentMatrix) {
const duel = duelStore.getState();
const hasEnhancedArmor = await hasEquipment(
const hasEnhancedArmor = hasEquipment(
110,
duel.protagonist.tank.equipment_preset,
equipment,
@@ -77,12 +75,12 @@ export function SpacedArmorSubSpaced({
? thickness * 1.03
: thickness;
}
async function handleAntagonistEquipmentChange(equipment: EquipmentMatrix) {
function handleAntagonistEquipmentChange(equipment: EquipmentMatrix) {
const duel = duelStore.getState();
const tankopediaEphemeral = tankopediaEphemeralStore.getState();
const shell = tankopediaEphemeral.customShell ?? duel.antagonist.shell;
const penetration = shell.penetration.near;
const hasCalibratedShells = await hasEquipment(
const hasCalibratedShells = hasEquipment(
103,
duel.antagonist.tank.equipment_preset,
equipment,
@@ -81,7 +81,7 @@ export function SpacedArmorSceneComponent({
const camera = useThree((state) => state.camera);
const shoot = useCallback(
async (
(
point: Vector3,
intersections: Intersection[],
allowRicochet: boolean,
@@ -103,12 +103,12 @@ export function SpacedArmorSceneComponent({
},
};
const hasCalibratedShells = await hasEquipment(
const hasCalibratedShells = hasEquipment(
103,
antagonist.tank.equipment_preset,
antagonist.equipmentMatrix,
);
const hasEnhancedArmor = await hasEquipment(
const hasEnhancedArmor = hasEquipment(
110,
protagonist.tank.equipment_preset,
protagonist.equipmentMatrix,
@@ -340,7 +340,7 @@ export function SpacedArmorSceneComponent({
props.scene.children,
true,
);
const outShot = await shoot(
const outShot = shoot(
lastLayer.point,
ricochetIntersections,
false,
@@ -386,13 +386,11 @@ export function SpacedArmorSceneComponent({
thickness,
} satisfies ArmorUserData
}
onClick={async (event) => {
onClick={(event) => {
event.stopPropagation();
const shot = (await shoot(
event.point,
event.intersections,
true,
))!;
const shot = shoot(event.point, event.intersections, true)!;
tankopediaEphemeralStore.setState({ shot });
}}
/>
@@ -165,14 +165,14 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
window.addEventListener('pointermove', handlePointerMove);
window.addEventListener('pointerup', handlePointerUp);
}
async function handlePointerMove(event: PointerEvent) {
function handlePointerMove(event: PointerEvent) {
const duel = duelStore.getState();
const hasImprovedVerticalStabilizer = await hasEquipment(
const hasImprovedVerticalStabilizer = hasEquipment(
122,
duel.protagonist.tank.equipment_preset,
duel.protagonist.equipmentMatrix,
);
const hasDownImprovedVerticalStabilizer = await hasEquipment(
const hasDownImprovedVerticalStabilizer = hasEquipment(
124,
duel.protagonist.tank.equipment_preset,
duel.protagonist.equipmentMatrix,
@@ -259,14 +259,14 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
window.addEventListener('pointermove', handlePointerMove);
window.addEventListener('pointerup', handlePointerUp);
}
async function handlePointerMove(event: PointerEvent) {
function handlePointerMove(event: PointerEvent) {
const duel = duelStore.getState();
const hasImprovedVerticalStabilizer = await hasEquipment(
const hasImprovedVerticalStabilizer = hasEquipment(
122,
duel.protagonist.tank.equipment_preset,
duel.protagonist.equipmentMatrix,
);
const hasDownImprovedVerticalStabilizer = await hasEquipment(
const hasDownImprovedVerticalStabilizer = hasEquipment(
124,
duel.protagonist.tank.equipment_preset,
duel.protagonist.equipmentMatrix,
@@ -340,14 +340,14 @@ export const StaticArmor = memo<ArmorSceneProps>(({ thicknessRange }) => {
window.addEventListener('pointermove', handlePointerMove);
window.addEventListener('pointerup', handlePointerUp);
}
async function handlePointerMove(event: PointerEvent) {
function handlePointerMove(event: PointerEvent) {
const duel = duelStore.getState();
const hasImprovedVerticalStabilizer = await hasEquipment(
const hasImprovedVerticalStabilizer = hasEquipment(
122,
duel.protagonist.tank.equipment_preset,
duel.protagonist.equipmentMatrix,
);
const hasDownImprovedVerticalStabilizer = await hasEquipment(
const hasDownImprovedVerticalStabilizer = hasEquipment(
124,
duel.protagonist.tank.equipment_preset,
duel.protagonist.equipmentMatrix,