mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-03 08:57:17 +00:00
NPC button no longer appears if combined resources are not enough
This commit is contained in:
@@ -37,7 +37,9 @@ if ( $building->allowWwUpgrade() ) {
|
||||
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 available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($uprequire['wood'] + $uprequire['clay'] + $uprequire['iron'] + $uprequire['crop']);
|
||||
if ( $session->userinfo['gold'] >= 3 && $building->getTypeLevel( 17 ) >= 1 && $village->atotal >= $total_required) {
|
||||
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/>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user