forked from Mirrors/openclonk
Don't crash on Call()
parent
2d05c9501c
commit
6e4b5bd0ca
|
@ -220,11 +220,16 @@ static C4Value FnCall(C4PropList * _this, C4Value * Pars)
|
||||||
if (!_this) return C4Value();
|
if (!_this) return C4Value();
|
||||||
C4AulParSet ParSet(&Pars[1], 9);
|
C4AulParSet ParSet(&Pars[1], 9);
|
||||||
C4AulFunc * fn = Pars[0].getFunction();
|
C4AulFunc * fn = Pars[0].getFunction();
|
||||||
if (!fn)
|
C4String * name;
|
||||||
fn = _this->GetFunc(Pars[0].getStr());
|
|
||||||
if (!fn)
|
if (!fn)
|
||||||
{
|
{
|
||||||
const char * s = FnStringPar(Pars[0].getStr());
|
name = Pars[0].getStr();
|
||||||
|
if (name)
|
||||||
|
fn = _this->GetFunc(name);
|
||||||
|
}
|
||||||
|
if (!fn)
|
||||||
|
{
|
||||||
|
const char * s = FnStringPar(name);
|
||||||
if (s[0] == '~')
|
if (s[0] == '~')
|
||||||
{
|
{
|
||||||
fn = _this->GetFunc(&s[1]);
|
fn = _this->GetFunc(&s[1]);
|
||||||
|
|
Loading…
Reference in New Issue