mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-19 09:40:59 +00:00
fix: invalid next level info with Master builder the only item in queue
#257
This commit is contained in:
@@ -11,11 +11,18 @@ if($bindicate == 1) {
|
|||||||
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
|
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
|
||||||
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
|
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
|
||||||
$master = count($database->getMasterJobsByField($village->wid,$id));
|
$master = count($database->getMasterJobsByField($village->wid,$id));
|
||||||
|
|
||||||
|
// master and loopsame would have duplicated level display,
|
||||||
|
// so we need to decrease loopsame if master is the only job left
|
||||||
|
if ($master == 1 && $loopsame == 1) {
|
||||||
|
$loopsame = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$uprequire = $building->resourceRequired($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
|
$uprequire = $building->resourceRequired($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
|
||||||
$mastertime = $uprequire['time'];
|
$mastertime = $uprequire['time'];
|
||||||
?>
|
?>
|
||||||
<p id="contract"><b><?php echo COSTS_UPGRADING_LEVEL;?> <?php echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master; ?>:<br />
|
<p id="contract"><b><?php echo COSTS_UPGRADING_LEVEL;?> <?php echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master; ?>:<br />
|
||||||
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><span class="little_res"><?php echo $uprequire['wood']; ?></span> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><span class="little_res"><?php echo $uprequire['clay']; ?></span> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><span class="little_res"><?php echo $uprequire['iron']; ?></span> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><span class="little_res"><?php echo $uprequire['crop']; ?></span> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
|
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><span class="little_res"><?php echo $uprequire['wood']; ?></span> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><span class="little_res"><?php echo $uprequire['clay']; ?></span> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><span class="little_res"><?php echo $uprequire['iron']; ?></span> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><span class="little_res"><?php echo $uprequire['crop']; ?></span> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
|
||||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
echo "|<a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||||
} ?><br />
|
} ?><br />
|
||||||
|
|||||||
Reference in New Issue
Block a user