mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-19 17:51:02 +00:00
NPC button no longer appears if combined resources are not enough
This commit is contained in:
@@ -66,7 +66,11 @@ $dur=round(${'u'.$i}['time'] * ($bid26[$village->resarray['f'.$id]]['attri'] / 1
|
||||
}
|
||||
$dur=$generator->getTimeFormat($dur);
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'u'.$i}['wood']."&r2=".${'u'.$i}['clay']."&r3=".${'u'.$i}['iron']."&r4=".${'u'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
echo "<td class=\"val\"><input type=\"text\" class=\"text\" name=\"t".$i."\" value=\"0\" maxlength=\"4\"></td>
|
||||
|
||||
Reference in New Issue
Block a user