Fix bug important
This commit is contained in:
@@ -10,7 +10,7 @@ let isEditing = false;
|
||||
|
||||
//fetch operatives data from JSON
|
||||
function fetchOperativesData() {
|
||||
fetch('/trlstats/static/json/operative.json')
|
||||
fetch('static/json/operative.json')
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
populateOperatives(data.operatives);
|
||||
@@ -283,15 +283,10 @@ function applyModifiers() {
|
||||
return;
|
||||
}
|
||||
if (mod.dataset.type === 'multiplicative-headshot') {
|
||||
if (!headshotBaseApplied) {
|
||||
const baseHeadshotModifier = document.querySelector("#modifiers input[data-type='multiplicative-headshot-base']");
|
||||
if (baseHeadshotModifier && !baseHeadshotModifier.checked) {
|
||||
baseHeadshotModifier.checked = true;
|
||||
headshotMultiplier += parseFloat(baseHeadshotModifier.value) - 1;
|
||||
headshotBaseApplied = true;
|
||||
}
|
||||
}
|
||||
// Only apply headshot multipliers if the base headshot modifier is active
|
||||
if (headshotBaseApplied) {
|
||||
headshotMultiplier += parseFloat(mod.value) - 1;
|
||||
}
|
||||
} else if (mod.dataset.type === 'multiplicative-headshot-base') {
|
||||
if (!headshotBaseApplied) {
|
||||
headshotMultiplier += parseFloat(mod.value) - 1;
|
||||
@@ -396,7 +391,10 @@ function applyBuff(buff, rpmModifier, reloadTimeModifier, damageModifier) {
|
||||
return;
|
||||
}
|
||||
if (buffType === 'multiplicative-headshot') {
|
||||
// Only apply if base headshot modifier is active
|
||||
if (headshotBaseApplied) {
|
||||
headshotMultiplier += value - 1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (type === 'rpm') {
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
"rpm": 60,
|
||||
"mag_size": 8,
|
||||
"reload_time": 2.8,
|
||||
"guntype": ["RIFLE", "SEMI-AUTO", "PRIMARY"]
|
||||
"guntype": ["RIFLE", "SEMI-AUTO", "PRIMARY", "WW2"]
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
</div>
|
||||
|
||||
<h3 class="about_us_text" style="text-align: center; margin-top: 2rem;">
|
||||
Thanks for using <b>TRL Stats</b> <3
|
||||
Thanks for using <b>TRL Stats</b>
|
||||
</h3>
|
||||
</main>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user