Fix creating account if $npcCheck is enabled

This commit is contained in:
slawkens 2021-05-23 02:55:27 +02:00
parent 135f393fc4
commit 80623580f2
2 changed files with 3 additions and 3 deletions

View File

@ -63,7 +63,7 @@ class DataLoader
self::$startTime = microtime(true); self::$startTime = microtime(true);
require LIBS . 'npc.php'; require_once LIBS . 'npc.php';
if(NPCs::loadFromXML()) { if(NPCs::loadFromXML()) {
success(self::$locale['step_database_loaded_npcs'] . self::getLoadedTime()); success(self::$locale['step_database_loaded_npcs'] . self::getLoadedTime());
} }

View File

@ -223,7 +223,7 @@ class Validator
$npcCheck = config('character_name_npc_check'); $npcCheck = config('character_name_npc_check');
if ($npcCheck) { if ($npcCheck) {
require LIBS . 'npc.php'; require_once LIBS . 'npc.php';
NPCS::load(); NPCS::load();
if(NPCS::$npcs && in_array(strtolower($name), NPCS::$npcs)) { if(NPCS::$npcs && in_array(strtolower($name), NPCS::$npcs)) {
self::$lastError = "Invalid name format. Do not use NPC Names"; self::$lastError = "Invalid name format. Do not use NPC Names";
@ -346,7 +346,7 @@ class Validator
$npcCheck = config('character_name_npc_check'); $npcCheck = config('character_name_npc_check');
if ($npcCheck) { if ($npcCheck) {
require LIBS . 'npc.php'; require_once LIBS . 'npc.php';
NPCS::load(); NPCS::load();
if(NPCS::$npcs && in_array($name_lower, NPCS::$npcs)) { if(NPCS::$npcs && in_array($name_lower, NPCS::$npcs)) {
self::$lastError = "Invalid name format. Do not use NPC Names"; self::$lastError = "Invalid name format. Do not use NPC Names";