fix: Send merchants link would not work for Support

This commit is contained in:
Martin Ambrus
2017-10-22 11:21:51 +02:00
parent 8c61c6ec63
commit a059aac482
+7 -2
View File
@@ -662,8 +662,13 @@ class Building {
} }
public function getTypeLevel($tid,$vid=0) { public function getTypeLevel($tid,$vid=0) {
global $village,$database; global $village,$database,$session;
// Support would not have a village, so this is irrelevant
if ($session->uid == 1) {
return 0;
}
$keyholder = array(); $keyholder = array();
if($vid == 0) { if($vid == 0) {
@@ -671,7 +676,7 @@ class Building {
} else { } else {
$resourcearray = $database->getResourceLevel($vid); $resourcearray = $database->getResourceLevel($vid);
} }
foreach(array_keys($resourcearray,$tid) as $key) { foreach(array_keys($resourcearray,$tid) as $key) {
if(strpos($key,'t')) { if(strpos($key,'t')) {
$key = preg_replace("/[^0-9]/", '', $key); $key = preg_replace("/[^0-9]/", '', $key);