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

跳转到内容


照片

Cargo overfilling MaxRess Butten

Classic

  • 请登录后回复
此主题暂无回复

#1 OPTtheTI

OPTtheTI

    Гуру

  • Пользователь
  • 180 帖子

发表于 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


由 OPTtheTI 编辑,28 March 2024 - 15:22。

  • 1