diff --git a/engine/Default/planet_attack_processing.php b/engine/Default/planet_attack_processing.php index 655a004c7..e101d466a 100644 --- a/engine/Default/planet_attack_processing.php +++ b/engine/Default/planet_attack_processing.php @@ -23,7 +23,7 @@ if (!$planet->exists()) { create_error('This planet does not exist.'); } -if (!$planet->isClaimed()) { +if (!$planet->hasOwner()) { create_error('This planet is not claimed.'); } @@ -75,7 +75,7 @@ if ($planet->isDestroyed()) { $db->query('UPDATE player SET land_on_planet = \'FALSE\' WHERE sector_id = ' . $db->escapeNumber($planet->getSectorID()) . ' AND game_id = ' . $db->escapeNumber($player->getGameID())); - $planet->removeClaimed(); + $planet->removeOwner(); $planet->removePassword(); // Prepare message for planet owners diff --git a/lib/Default/SmrPlanet.class.php b/lib/Default/SmrPlanet.class.php index 186003238..6b6b2e779 100644 --- a/lib/Default/SmrPlanet.class.php +++ b/lib/Default/SmrPlanet.class.php @@ -231,6 +231,10 @@ public function hasOwner() { return $this->ownerID != 0; } + public function removeOwner() { + $this->setOwnerID(0); + } + public function setOwnerID($claimerID) { if ($this->ownerID == $claimerID) { return; @@ -1025,14 +1029,6 @@ public function getInhabitableTime() { return $this->inhabitableTime; } - public function isClaimed() { - return $this->ownerID > 0; - } - - public function removeClaimed() { - $this->setOwnerID(0); - } - public function getExamineHREF() { return SmrSession::getNewHREF(create_container('skeleton.php', 'planet_examine.php')); } @@ -1297,7 +1293,7 @@ public function &killPlanetByPlayer(AbstractSmrPlayer $killer) { //kick everyone from planet $this->db->query('UPDATE player SET land_on_planet = \'FALSE\' WHERE ' . $this->SQL); - $this->removeClaimed(); + $this->removeOwner(); $this->removePassword(); return $return; } diff --git a/templates/Default/engine/Default/planet_financial.php b/templates/Default/engine/Default/planet_financial.php index 9d0c555f4..8bdfdf48a 100644 --- a/templates/Default/engine/Default/planet_financial.php +++ b/templates/Default/engine/Default/planet_financial.php @@ -15,7 +15,7 @@

 

isClaimed()) { +if (!$ThisPlanet->hasOwner()) { echo "This planet must be claimed before you can bond funds here.

"; } else { ?> You are able to transfer these credits into a planetary bond.
@@ -34,7 +34,7 @@ isClaimed()) { ?> +if ($ThisPlanet->hasOwner()) { ?>
Bond Funds