mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 01:34:55 +02:00
* better error handling for monsters and spells loader
* check if file exist before loading * save errors to system/logs/error.log
This commit is contained in:
@@ -65,7 +65,12 @@ $canEdit = hasFlag(FLAG_CONTENT_MONSTERS) || admin();
|
||||
if(isset($_POST['reload_monsters']) && $canEdit)
|
||||
{
|
||||
require LIBS . 'creatures.php';
|
||||
Creatures::loadFromXML(true);
|
||||
if(Creatures::loadFromXML(true))
|
||||
if(Creatures::getMonstersList()->hasErrors())
|
||||
error('There were some problems loading your monsters.xml file. Please check system/logs/error.log for more info.');
|
||||
else {
|
||||
error(Creatures::getLastError());
|
||||
}
|
||||
}
|
||||
|
||||
if($canEdit)
|
||||
|
Reference in New Issue
Block a user