* check if monster file exist before loading it

This commit is contained in:
slawkens1 2017-10-15 21:53:44 +02:00
parent 3f1c638a14
commit 6d81a29bb6

View File

@ -118,7 +118,9 @@ class OTS_MonstersList implements Iterator, Countable, ArrayAccess
// loads file
$monster = new OTS_Monster();
//echo $this->monstersPath . $this->monsters[$name];
$monster->loadXML(trim(file_get_contents($this->monstersPath . $this->monsters[$name])));
if(file_exists($this->monstersPath . $this->monsters[$name])) {
$monster->loadXML(trim(file_get_contents($this->monstersPath . $this->monsters[$name])));
}
return $monster;
}