mirror of
https://github.com/slawkens/myaac.git
synced 2025-05-03 20:59:20 +02:00
Improve character npc name check
This commit is contained in:
parent
b05780529a
commit
a2fcb21b4f
@ -333,11 +333,15 @@ class Validator
|
|||||||
if ($npcCheck) {
|
if ($npcCheck) {
|
||||||
require_once LIBS . 'npc.php';
|
require_once LIBS . 'npc.php';
|
||||||
NPCS::load();
|
NPCS::load();
|
||||||
if(NPCS::$npcs && in_array($name_lower, NPCS::$npcs)) {
|
if(NPCS::$npcs) {
|
||||||
self::$lastError = "Invalid name format. Do not use NPC Names";
|
foreach (NPCs::$npcs as $npc) {
|
||||||
|
if(strpos($name_lower, $npc) !== false) {
|
||||||
|
self::$lastError = 'Your name cannot contains NPC name.';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user