From e340caf201c72f7b8ed25183143cf9ebcc288266 Mon Sep 17 00:00:00 2001 From: IM23a-spirgif Date: Thu, 22 May 2025 08:41:33 +0200 Subject: [PATCH] Simplified weapon creation function in filterWeapons.js --- static/filterWeapons.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/static/filterWeapons.js b/static/filterWeapons.js index e6ffc86..7f9b77f 100644 --- a/static/filterWeapons.js +++ b/static/filterWeapons.js @@ -564,7 +564,6 @@ form.addEventListener('submit', e => { const newId = weapons.length ? Math.max(...weapons.map(w => w.id)) + 1 : 1; - const weapon = { id: newId, name: data.get('name'), @@ -575,22 +574,12 @@ form.addEventListener('submit', e => { damage_multiplier: parseFloat(data.get('multiplier')), guntype: data.getAll('gun-type') }; - - // 2) Add it local weapons.push(weapon); - - // 3) Refresh UI - populateWeapons(); // repopulate