#9029 Added starmap 2

This commit is contained in:
Daniel Maya 2022-07-12 13:45:01 +02:00
parent a71c26b4a7
commit 4f7918114b
1 changed files with 6 additions and 13 deletions

View File

@ -4300,19 +4300,13 @@ function agents_get_starmap(int $id_agent, float $width=0, float $height=0)
{
ui_require_css_file('heatmap');
// $all_modules = agents_get_modules($id_agent);
// if (empty($all_modules)) {
// return null;
// }
// $total_modules = count($all_modules);
$all_modules = [];
$total_modules = 200;
$contador = 0;
while ($contador < $total_modules) {
$contador++;
$all_modules[$contador] = '';
$all_modules = agents_get_modules($id_agent);
if (empty($all_modules)) {
return null;
}
$total_modules = count($all_modules);
// Best square.
$high = (float) max($width, $height);
$low = 0.0;
@ -4345,8 +4339,7 @@ function agents_get_starmap(int $id_agent, float $width=0, float $height=0)
$cont = 1;
foreach ($all_modules as $key => $value) {
// Colour by status.
// $status = modules_get_agentmodule_status($key);
$status = random_int(0, 5);
$status = modules_get_agentmodule_status($key);
switch ($status) {
case 0:
case 4: