Improve character npc name check

This commit is contained in:
slawkens 2023-07-22 11:35:05 +02:00
parent b05780529a
commit a2fcb21b4f

View File

@ -333,9 +333,13 @@ class Validator
if ($npcCheck) {
require_once LIBS . 'npc.php';
NPCS::load();
if(NPCS::$npcs && in_array($name_lower, NPCS::$npcs)) {
self::$lastError = "Invalid name format. Do not use NPC Names";
return false;
if(NPCS::$npcs) {
foreach (NPCs::$npcs as $npc) {
if(strpos($name_lower, $npc) !== false) {
self::$lastError = 'Your name cannot contains NPC name.';
return false;
}
}
}
}