Skip to content

Commit

Permalink
Set variables before use
Browse files Browse the repository at this point in the history
  • Loading branch information
thekabal committed Sep 20, 2021
1 parent 6a72ee4 commit cf7d412
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions classes/KabalHunt.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public static function hunt(\PDO $pdo_db, string $lang, array $playerinfo, int $
\Tki\PlayerLog::writeLog($pdo_db, $playerinfo['ship_id'], LogEnums::RAW, "Kabal used a wormhole to warp to sector $targetinfo[sector] where he is hunting player $targetinfo[character_name].");
if (!$result)
{
$error = '';
// $error = $old_db->ErrorMsg();
\Tki\PlayerLog::writeLog($pdo_db, $playerinfo['ship_id'], LogEnums::RAW, "Move failed with error: $error ");

Expand Down
5 changes: 5 additions & 0 deletions classes/KabalToPlanet.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ public static function planet(\PDO $pdo_db, string $lang, int $planet_id, Regist
$stmt->bindParam(':planetinfo_planet_id', $planetinfo['planet_id'], \PDO::PARAM_INT);
$stmt->execute();
$shiplist = $stmt->fetchAll(\PDO::FETCH_ASSOC);
$i = 0;

if (is_array($shiplist))
{
Expand All @@ -369,6 +370,10 @@ public static function planet(\PDO $pdo_db, string $lang, int $planet_id, Regist
{
$shipsonplanet = count($ships_present);
}
else
{
$shipsonplanet = 0;
}

if ($shipsonplanet == 0)
{
Expand Down

0 comments on commit cf7d412

Please sign in to comment.