Перейти к содержимому

Hopp til innhold


Bilde

Cargo overfilling MaxRess Butten

Classic

  • Vennligst logg inn for å svare
Ingen svar på dette emnet

#1 OPTtheTI

OPTtheTI

    Гуру

  • Пользователь
  • 180 innlegg

Publisert 28 March 2024 - 15:26

Max Ress Butten is this
Изображение
 

But it use wrong function this function is for the max Buttens without calculation

can see here
Изображение

 

so admins change it easy fix Remove the S at the end of the function in your php that must fix the anoing bug and you get it since start from server.

here the right one

Изображение

 

iam not sure at what class.page it is but this a a thing form 3 Minutes to fix but please do first test it on a test server.

Have fun.

Maybe add some Priors from deut to kris to met but if you do test it pls

function maxResource() {    var storCap = data.fleetroom - data.consumption;    var availableResources = {        'metal': Math.max(0, getRessource('metal') - HoldResources['metal']),        'crystal': Math.max(0, getRessource('crystal') - HoldResources['crystal']),        'deuterium': Math.max(0, getRessource('deuterium') - HoldResources['deuterium'] - data.consumption)    };    var resourceOrder = ['deuterium', 'crystal', 'metal']; // Priorisierung der Ressourcen    var totalTransported = 0;    resourceOrder.forEach(function(id) {        var thisResourceChosen = parseInt(document.getElementsByName(id)[0].value);        if (isNaN(thisResourceChosen)) thisResourceChosen = 0;        var freeCapacity = Math.max(storCap - totalTransported, 0);        var amountToAdd = Math.min(freeCapacity, availableResources[id]);        document.getElementsByName(id)[0].value = amountToAdd;        totalTransported += amountToAdd;    });    calculateTransportCapacity();    countDots();}

i need to add that´s not the 100% Calculation you have some error in your code in flotten.js 

and this funktion maybe only work for singel buttens but for MAxRess butten all ress you have no calculation


Redigert av OPTtheTI, 28 March 2024 - 15:22.

  • 1