mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
Ignore arrays in config.lua (fixes experienceStages loading)
In future we want to parse arrays too, this is just a temporary solution Thread: https://otland.net/threads/myacc-problem.274795/
This commit is contained in:
parent
5a8bcec014
commit
ebe900fca8
@ -926,6 +926,12 @@ function load_config_lua($filename)
|
|||||||
if(count($lines) > 0) {
|
if(count($lines) > 0) {
|
||||||
foreach($lines as $ln => $line)
|
foreach($lines as $ln => $line)
|
||||||
{
|
{
|
||||||
|
$line = trim($line);
|
||||||
|
if(@$line[0] === '{' || @$line[0] === '}') {
|
||||||
|
// arrays are not supported yet
|
||||||
|
// just ignore the error
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$tmp_exp = explode('=', $line, 2);
|
$tmp_exp = explode('=', $line, 2);
|
||||||
if(strpos($line, 'dofile') !== false)
|
if(strpos($line, 'dofile') !== false)
|
||||||
{
|
{
|
||||||
@ -952,9 +958,10 @@ function load_config_lua($filename)
|
|||||||
$result[$key] = (string) substr(substr($value, 1), 0, -1);
|
$result[$key] = (string) substr(substr($value, 1), 0, -1);
|
||||||
elseif(in_array($value, array('true', 'false')))
|
elseif(in_array($value, array('true', 'false')))
|
||||||
$result[$key] = ($value === 'true') ? true : false;
|
$result[$key] = ($value === 'true') ? true : false;
|
||||||
elseif(@$value[0] === '{' && @$value[strlen($value) - 1] === '}') {
|
elseif(@$value[0] === '{') {
|
||||||
// arrays are not supported yet
|
// arrays are not supported yet
|
||||||
// just ignore the error
|
// just ignore the error
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user