Update weapon data fetching and dropdown handling

This commit is contained in:
IM23a-spirgif
2025-05-19 22:57:02 +02:00
parent 347897b7c5
commit 2385a79ff8
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ let ignoreHeadshots = false;
// Function to fetch operatives data from JSON
function fetchOperativesData() {
fetch('/static/json/operative.json')
fetch('/trlstats/static/json/operative.json')
.then(response => response.json())
.then(data => {
populateOperatives(data.operatives); // Populate the operative dropdown once data is loaded
@@ -573,7 +573,7 @@ form.addEventListener('submit', e => {
mag_size: parseFloat(data.get('magazin')),
reload_time: parseFloat(data.get('reload-time')),
damage_multiplier: parseFloat(data.get('multiplier')),
guntype: data.get('gun-type') ? [data.get('gun-type')] : []
guntype: data.getAll('gun-type')
};
// 2) Add it local
+2 -2
View File
@@ -71,9 +71,9 @@
<div class="select-wrapper">
<label for="gun-type">Weapon Type:</label>
<select id="gun-type" name="gun-type">
<select id="gun-type" name="gun-type" multiple required>
<option value="">Select a type</option>
<option value="PISTOL">Pistol</option>
<option value="PRIMARY">Pistol</option>
<option value="SECONDARY">Secondary</option>
<option value="WW2">WW2</option>
<option value="RIFLE">Rifle</option>