From 4f7918114bd157391d19eb1e379aac5edd92fadc Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Tue, 12 Jul 2022 13:45:01 +0200 Subject: [PATCH] #9029 Added starmap 2 --- pandora_console/include/functions_agents.php | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/pandora_console/include/functions_agents.php b/pandora_console/include/functions_agents.php index 5c337f912b..3962538669 100644 --- a/pandora_console/include/functions_agents.php +++ b/pandora_console/include/functions_agents.php @@ -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: