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


Фотография

Cargo overfilling MaxRess Butten

Classic

  • Авторизуйтесь для ответа в теме
В этой теме нет ответов

#1 OPTtheTI

OPTtheTI

    Игрок

  • Пользователь
  • 31 сообщений

Отправлено Сегодня, 15:26

Max Ress Butten is this
Screenshot-9.png
 

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

can see here
Screenshot-11.png

 

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

Screenshot-10.png

 

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


Сообщение отредактировал OPTtheTI: Сегодня, 15:22

  • 0