mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-31 15:47:14 +00:00
NPC button no longer appears if combined resources are not enough
This commit is contained in:
@@ -133,7 +133,9 @@
|
||||
<img class="clock" src="img/x.gif" alt="Duration" title="<?php echo DURATION; ?>" />
|
||||
<?php echo $training_time; ?>
|
||||
<?php
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($wood + $clay + $iron + $crop);
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".$wood."&r2=".$clay."&r3=".$iron."&r4=".$crop."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
?>
|
||||
@@ -169,7 +171,9 @@
|
||||
<img class="clock" src="img/x.gif" alt="Duration" title="<?php echo DURATION; ?>" />
|
||||
<?php echo $training_time; ?>
|
||||
<?php
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($wood + $clay + $iron + $crop);
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".$wood."&r2=".$clay."&r3=".$iron."&r4=".$crop."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user