mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 09:19:22 +02:00
Fix if <flags> are not present in monster.xml
This commit is contained in:
parent
9ea2a5067f
commit
57b47ab798
@ -135,13 +135,14 @@ class OTS_Monster extends DOMDocument
|
||||
{
|
||||
$flags = array();
|
||||
|
||||
// read all flags
|
||||
foreach( $this->documentElement->getElementsByTagName('flags')->item(0)->getElementsByTagName('flag') as $flag)
|
||||
{
|
||||
$flag = $flag->attributes->item(0);
|
||||
if ($this->documentElement->getElementsByTagName('flags')->item(0)) {
|
||||
foreach( $this->documentElement->getElementsByTagName('flags')->item(0)->getElementsByTagName('flag') as $flag)
|
||||
{
|
||||
$flag = $flag->attributes->item(0);
|
||||
|
||||
$flags[$flag->nodeName] = (int) $flag->nodeValue;
|
||||
}
|
||||
$flags[$flag->nodeName] = (int) $flag->nodeValue;
|
||||
}
|
||||
}
|
||||
|
||||
return $flags;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user