From 8933b0b55f0212bd9714e2d223a7db2ea046b967 Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Sun, 5 Nov 2017 15:04:20 +0100 Subject: [PATCH] fix: master builder doesn't subtract gold but insta-builds anyway --- GameEngine/Building.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GameEngine/Building.php b/GameEngine/Building.php index f97baaa4..b1c38ee5 100755 --- a/GameEngine/Building.php +++ b/GameEngine/Building.php @@ -806,12 +806,13 @@ class Building { } else { // if we only have 2 gold, we need to cancel this job, as there will never // be enough gold now in our account to finish this up + $exclude_master = true; $q = "DELETE FROM ".TB_PREFIX."bdata WHERE id = ".(int) $jobs['id']; $database->query($q); } } - if ($database->query($q) && ($enought_res == 1 or $jobs['master'] == 0)) { + if (!isset($exclude_master) && $database->query($q) && ($enought_res == 1 or $jobs['master'] == 0)) { $database->modifyPop($jobs['wid'],$resource['pop'],0); $database->addCP($jobs['wid'],$resource['cp']); $q = "DELETE FROM ".TB_PREFIX."bdata where id = ".(int) $jobs['id'];