From 901a8283c314b75f1a6fe6fc32504646ef6639d7 Mon Sep 17 00:00:00 2001 From: jgalat Date: Mon, 11 May 2015 22:26:38 -0300 Subject: [PATCH 1/3] Fixed bug in Xgp Implementation --- implementations/Xgp/missionCaseAttack.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementations/Xgp/missionCaseAttack.php b/implementations/Xgp/missionCaseAttack.php index 43dd9ff..a2905d3 100644 --- a/implementations/Xgp/missionCaseAttack.php +++ b/implementations/Xgp/missionCaseAttack.php @@ -328,7 +328,7 @@ function sendMessage($FleetRow, $report, $lang, $resource) $style = "red"; } $raport = "" . $lang['sys_mess_attack_report'] . " [" . $FleetRow['fleet_end_galaxy'] . ":" . $FleetRow['fleet_end_system'] . ":" . $FleetRow['fleet_end_planet'] . "]"; - SendSimpleMessage($FleetRow['fleet_owner'], '', $FleetRow['fleet_start_time'], 3, $lang['sys_mess_tower'], $raport, ''); + SendSimpleMessage($id, '', $FleetRow['fleet_start_time'], 3, $lang['sys_mess_tower'], $raport, ''); } foreach ($idDefs as $id) { From aa4a585bf969c77ec392d3672698bd2562d3a84d Mon Sep 17 00:00:00 2001 From: jgalat Date: Mon, 11 May 2015 22:28:14 -0300 Subject: [PATCH 2/3] Fixed bug in utils/Math.php --- utils/Math.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/Math.php b/utils/Math.php index 73fab5b..af04a76 100644 --- a/utils/Math.php +++ b/utils/Math.php @@ -80,7 +80,7 @@ public static function tryEvent($probability, $callback, $callbackParam) { throw new Exception(); } - if (mt_rand(0, 99) <= $probability) + if (mt_rand(0, 99) < $probability) return call_user_func($callback, $callbackParam); return false; } @@ -106,4 +106,4 @@ public static function matrix_scalar_moltiplication($matrix, $scalar) } */ } -?> \ No newline at end of file +?> From 3df765450b7b8a9498238c8edfc9b13d78349bad Mon Sep 17 00:00:00 2001 From: jgalat Date: Mon, 11 May 2015 22:29:57 -0300 Subject: [PATCH 3/3] Fixed bug in core/BattleReport.php. --- core/BattleReport.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/BattleReport.php b/core/BattleReport.php index 06de5b3..82b640a 100644 --- a/core/BattleReport.php +++ b/core/BattleReport.php @@ -245,7 +245,7 @@ public function tryMoon() } public function getMoonProb() { - return min(round(array_sum($this->getDebris()) / MOON_UNIT_PROB), MAX_MOON_PROB); + return min(floor(array_sum($this->getDebris()) / MOON_UNIT_PROB), MAX_MOON_PROB); } public function getAttackerDebris() {