From 177b2bcf1d3dd97bd666992d5c9bfdbf1660aee0 Mon Sep 17 00:00:00 2001 From: Shadow Date: Sun, 8 Dec 2013 14:05:53 +0200 Subject: [PATCH] Update db_MYSQL.php --- GameEngine/Database/db_MYSQL.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/GameEngine/Database/db_MYSQL.php b/GameEngine/Database/db_MYSQL.php index 51412cac..8fa0b8be 100644 --- a/GameEngine/Database/db_MYSQL.php +++ b/GameEngine/Database/db_MYSQL.php @@ -567,16 +567,17 @@ class MYSQL_DB { return mysql_query($q, $this->connection); } - public function modifyOasisLoyalty($wref) { - if($this->isVillageOases($wref) != 0) { - $OasisInfo = $this->getOasisInfo($wref); - if($OasisInfo['conqured'] != 0) { - $LoyaltyAmendment = floor(100 / min(3,(4-$this->VillageOasisCount($OasisInfo['conqured'])))); - $q = "UPDATE `".TB_PREFIX."odata` SET loyalty=loyalty-$LoyaltyAmendment, lastupdated=".time()." WHERE wref=$wref"; - return mysql_query($q, $this->connection); - } - } - } + public function modifyOasisLoyalty($wref) { + if($this->isVillageOases($wref) != 0) { + $OasisInfo = $this->getOasisInfo($wref); + if($OasisInfo['conqured'] != 0) { + $LoyaltyAmendment = floor(100 / min(3,(4-$this->VillageOasisCount($OasisInfo['conqured'])))); + $q = "UPDATE `".TB_PREFIX."odata` SET loyalty=loyalty-$LoyaltyAmendment, lastupdated=".time()." WHERE wref=$wref"; + $result=mysql_query($q, $this->connection); + return $OasisInfo['loyalty']-$LoyaltyAmendment; + } + } + } function populateOasis() { $q = "SELECT * FROM " . TB_PREFIX . "wdata where oasistype != 0";