mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 17:59:22 +02:00
Fix if <flags> is not present in monster.xml
This commit is contained in:
parent
e5b4d2c6b3
commit
81b6652738
@ -129,20 +129,21 @@ class OTS_Monster extends DOMDocument
|
|||||||
* @return array Flags.
|
* @return array Flags.
|
||||||
* @throws DOMException On DOM operation error.
|
* @throws DOMException On DOM operation error.
|
||||||
*/
|
*/
|
||||||
public function getFlags()
|
public function getFlags()
|
||||||
{
|
{
|
||||||
$flags = array();
|
$flags = array();
|
||||||
|
|
||||||
// read all flags
|
if ($this->documentElement->getElementsByTagName('flags')->item(0)) {
|
||||||
foreach( $this->documentElement->getElementsByTagName('flags')->item(0)->getElementsByTagName('flag') as $flag)
|
foreach( $this->documentElement->getElementsByTagName('flags')->item(0)->getElementsByTagName('flag') as $flag)
|
||||||
{
|
{
|
||||||
$flag = $flag->attributes->item(0);
|
$flag = $flag->attributes->item(0);
|
||||||
|
|
||||||
$flags[$flag->nodeName] = (int) $flag->nodeValue;
|
$flags[$flag->nodeName] = (int) $flag->nodeValue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return $flags;
|
return $flags;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns specified flag value.
|
* Returns specified flag value.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user