Filters/Misc

* be a bit more lenient on level inputs
 * fix displaying array of requirements on error
This commit is contained in:
Sarjuuk
2025-10-06 15:50:33 +02:00
parent 704894c1e3
commit 452615a92d
7 changed files with 44 additions and 25 deletions

View File

@@ -1142,6 +1142,27 @@ abstract class Util
return $bits;
}
public static function toString(mixed $var) : string
{
if (is_array($var))
return '[' . implode(', ', array_map(self::toString(...), $var)) . ']';
if (is_object($var))
{
// hm, respect object stringability?
// if ($var instanceof Stringable)
// return (string)$var;
$buff = [];
foreach ($var as $k => $v)
$buff[] = $k.':'.self::toString($v);
return '{' . implode(', ', $buff) . '}';
}
return (string)$var;
}
public static function buildPosFixMenu(int $mapId, float $posX, float $posY, int $type, int $guid, int $parentArea = 0, int $parentFloor = 0) : array
{
$points = WorldPosition::toZonePos($mapId, $posX, $posY);