Core/Cleanup

* try to give included files a logical structure
 * move objects from Util and Game to their own files
 * make non-essential files auto-loaded
This commit is contained in:
Sarjuuk
2025-04-01 19:46:19 +02:00
parent 3a6c86092b
commit db1d3ccace
32 changed files with 1440 additions and 1323 deletions

View File

@@ -121,7 +121,7 @@ CLISetup::registerUtility(new class extends UtilityScript
if (CLI::read(['x' => ['['.CLI::bold('c').']ontinue anyway? ['.CLI::bold('r').']etry? ['.CLI::bold('a').']bort?', true, true, '/c|r|a/i']], $uiCRA) && $uiCRA)
{
CLI::write();
switch(strtolower($uiCRA['x']))
switch (strtolower($uiCRA['x']))
{
case 'c':
$this->saveProgress($idx);

View File

@@ -312,13 +312,13 @@ CLISetup::registerSetup("sql", new class extends SetupScript
$notice = '[points] '.str_pad('['.$point['guid'].']', 9).' manually moved to [A:'.($point['areaId'] ?? 0).' => '.$area.'; F: '.$floor.']';
}
if ($points = Game::worldPosToZonePos($point['map'], $point['posX'], $point['posY'], $area, $floor))
if ($points = WorldPosition::toZonePos($point['map'], $point['posX'], $point['posY'], $area, $floor))
{
// if areaId is set and we match it .. we're fine .. mostly
if (count($points) == 1 && $area == $points[0]['areaId'])
return ['areaId' => $points[0]['areaId'], 'posX' => $points[0]['posX'], 'posY' => $points[0]['posY'], 'floor' => $points[0]['floor']];
$point = Game::checkCoords($points); // try to determine best found point by alphamap
$point = WorldPosition::checkZonePos($points); // try to determine best found point by alphamap
return ['areaId' => $point['areaId'], 'posX' => $point['posX'], 'posY' => $point['posY'], 'floor' => $point['floor']];
}