mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-17 16:51:00 +00:00
fix traps training and by this fix also the 4294966344 setler bug too
This commit is contained in:
+54
-18
@@ -37,12 +37,11 @@
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<p>Your currently have <b>0</b> traps, <b>0</b> of which are occupied.</p>
|
||||
<form method="POST" name="snd" action="build.php"><input type="hidden"
|
||||
name="id" value="22" /> <input type="hidden"
|
||||
name="z" value="17" /> <input type="hidden" name="a"
|
||||
value="2" />
|
||||
|
||||
<p>Your currently have <b><?php echo $village->unitarray['u99']; ?></b> traps, <b><?php echo $village->unitarray['u99o']; ?></b> of which are occupied.</p>
|
||||
<?php if ($building->getTypeLevel(36) > 0) { ?>
|
||||
<form method="POST" name="snd" action="build.php">
|
||||
<input type="hidden" name="id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="ft" value="t1" />
|
||||
<table cellpadding="1" cellspacing="1" class="build_details">
|
||||
<thead>
|
||||
|
||||
@@ -59,31 +58,68 @@
|
||||
<div class="tit"><img class="unit u99" src="img/x.gif"
|
||||
alt="Trap"
|
||||
title="Trap" /> <a href="#"
|
||||
onClick="return Popup(36,4,'gid');">Trap</a> <span class="info">(Available: 0)</span>
|
||||
onClick="return Popup(36,4,'gid');">Trap</a> <span class="info">(Available: <?php echo $village->unitarray['u99']; ?>)</span>
|
||||
</div>
|
||||
<div class="details">
|
||||
<span><img class="r1" src="img/x.gif"
|
||||
<span><img class="r1" src="img/x.gif"
|
||||
alt="Lumber" title="Lumber" />20|</span><span><img class="r2" src="img/x.gif"
|
||||
alt="Clay" title="Clay" />30|</span><span><img class="r3" src="img/x.gif"
|
||||
alt="Iron" title="Iron" />10|</span><span><img class="r4" src="img/x.gif"
|
||||
alt="Crop" title="Crop" />20|</span><span><img class="r5" src="img/x.gif" alt="Crop consumption"
|
||||
title="Crop consumption" />0|<img class="clock" src="img/x.gif"
|
||||
alt="Duration" title="Duration" />0:10:00</span>
|
||||
alt="Duration" title="Duration" /><?php $dur=$generator->getTimeFormat(round(${'u99'}['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur; ?></span>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td class="val"><input type="text" class="text" name="t99" value="0"
|
||||
maxlength="4"></td>
|
||||
<td class="max"><a href="#"
|
||||
onClick="document.snd.t99.value=<?php echo $bid36[$village->resarray['f'.$id]]['attri']; ?>">(<?php echo $bid36[$village->resarray['f'.$id]]['attri']; ?>)</a></td>
|
||||
<?php
|
||||
$max = $bid36[$village->resarray['f'.$id]]['attri'] - $village->unitarray['u99'];
|
||||
if($max < 0){
|
||||
$max = 0;
|
||||
}
|
||||
?>
|
||||
<td class="val"><input type="text" class="text" name="t99" value="0" maxlength="4"></td>
|
||||
<td class="max"><a href="#" onClick="document.snd.t99.value=<?php echo $max; ?>">(<?php echo $max; ?>)</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p><input type="image" value="ok" name="s1" id="btn_train"
|
||||
class="dynamic_img" src="img/x.gif" alt="train" /></p>
|
||||
</form>
|
||||
<?php
|
||||
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="train" onclick="this.disabled=true;this.form.submit();"/></form></p>
|
||||
<?php
|
||||
} else {
|
||||
echo "<b>Training can commence when trapper are completed.</b><br>\n";
|
||||
}
|
||||
$trainlist = $technology->getTrainingList(8);
|
||||
if(count($trainlist) > 0) {
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
||||
<thead><tr>
|
||||
<td>Training</td>
|
||||
<td>Duration</td>
|
||||
<td>Finished</td>
|
||||
</tr></thead>
|
||||
<tbody>";
|
||||
$TrainCount = 0;
|
||||
foreach($trainlist as $train) {
|
||||
$TrainCount++;
|
||||
echo "<tr><td class=\"desc\">";
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".U99."\" title=\"".U99."\" />";
|
||||
echo $train['amt']." ".U99."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['commence']+$train['eachtime'])-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat(($train['commence']+($train['eachtime']*$train['amt']))-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
echo "</td><td class=\"fin\">";
|
||||
$time = $generator->procMTime($train['commence']+($train['eachtime']*$train['amt']));
|
||||
if($time[0] != "today") {
|
||||
echo "on ".$time[0]." at ";
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3">The next unit will be finished in <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
@@ -87,7 +87,7 @@ if($mainbuilding >= 10 && $village->capital == 0 && $largeA['owner'] == $session
|
||||
if($mainbuilding >= 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) {
|
||||
include("avaliable/greatgranary.tpl");
|
||||
}
|
||||
if(($trapper ==0 || $trapper == 10) && $rallypoint >= 1 && $session->tribe == 3 && $id != 39 && $id != 40) {
|
||||
if(($trapper ==0 || $trapper == 20) && $rallypoint >= 1 && $session->tribe == 3 && $id != 39 && $id != 40) {
|
||||
include("avaliable/trapper.tpl");
|
||||
}
|
||||
if($rallypoint == 0 && $id != 40) {
|
||||
|
||||
Reference in New Issue
Block a user