MJ: attack coordinator update / various fixes . captcha and back button and jitterloop 2 secs
This commit is contained in:
@@ -193,7 +193,27 @@ function gatherState() {
|
||||
};
|
||||
});
|
||||
|
||||
return { player, player_id, alliance_id, total_points, world_id: world, towns: townList };
|
||||
// ---- World speed & unit speed table (for attack planner calculations) -----
|
||||
let world_speed = 1;
|
||||
let unit_speeds = {};
|
||||
try {
|
||||
world_speed = uw.Game?.world_speed || 1;
|
||||
const gdUnits = uw.GameData?.units || {};
|
||||
for (const [uid, ud] of Object.entries(gdUnits)) {
|
||||
if (ud.speed !== undefined) {
|
||||
unit_speeds[uid] = {
|
||||
speed: ud.speed || 0,
|
||||
population: ud.population || 1,
|
||||
is_naval: !!(ud.naval || ud.is_naval || false),
|
||||
capacity: ud.capacity || 0, // transport ship cargo
|
||||
};
|
||||
}
|
||||
}
|
||||
} catch (e) { log(`unit speed gather failed: ${e}`); }
|
||||
|
||||
return { player, player_id, alliance_id, total_points, world_id: world,
|
||||
world_speed, unit_speeds, towns: townList };
|
||||
|
||||
}
|
||||
|
||||
function pushState() {
|
||||
|
||||
Reference in New Issue
Block a user