mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-30 07:07:14 +00:00
fix: master builder doesn't subtract gold but insta-builds anyway
This commit is contained in:
@@ -806,12 +806,13 @@ class Building {
|
|||||||
} else {
|
} else {
|
||||||
// if we only have 2 gold, we need to cancel this job, as there will never
|
// 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
|
// 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'];
|
$q = "DELETE FROM ".TB_PREFIX."bdata WHERE id = ".(int) $jobs['id'];
|
||||||
$database->query($q);
|
$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->modifyPop($jobs['wid'],$resource['pop'],0);
|
||||||
$database->addCP($jobs['wid'],$resource['cp']);
|
$database->addCP($jobs['wid'],$resource['cp']);
|
||||||
$q = "DELETE FROM ".TB_PREFIX."bdata where id = ".(int) $jobs['id'];
|
$q = "DELETE FROM ".TB_PREFIX."bdata where id = ".(int) $jobs['id'];
|
||||||
|
|||||||
Reference in New Issue
Block a user