Skip to content

Commit

Permalink
GH-230 Abandoning non-planets should not decrement task's counter, as…
Browse files Browse the repository at this point in the history
… they cannot be colonized
  • Loading branch information
mdziekon committed Jul 6, 2022
1 parent 97b485b commit 6bc2ff2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@

namespace UniEngine\Engine\Modules\Overview\Screens\AbandonPlanet\Utils\Effects;

use UniEngine\Engine\Includes\Helpers\World;

/**
* @param array $params
* @param arrayRef $params['user']
* @param arrayRef $params['planet']
*/
function triggerUserTasksUpdates($props) {
$user = &$props['user'];
$planet = &$props['planet'];

if ($planet['planet_type'] != World\Enums\PlanetType::Planet) {
return;
}

// Prevent abandoning Planet to make mission faster
Tasks_TriggerTask(
Expand Down
1 change: 1 addition & 0 deletions overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
{
Overview\Screens\AbandonPlanet\Utils\Effects\triggerUserTasksUpdates([
'user' => &$_User,
'planet' => &$_Planet,
]);

// User Development Log
Expand Down

0 comments on commit 6bc2ff2

Please sign in to comment.