Don't crash on Call()

scancodes-fix
Günther Brammer 2012-12-30 00:59:50 +01:00
parent 2d05c9501c
commit 6e4b5bd0ca
1 changed files with 8 additions and 3 deletions

View File

@ -220,11 +220,16 @@ static C4Value FnCall(C4PropList * _this, C4Value * Pars)
if (!_this) return C4Value();
C4AulParSet ParSet(&Pars[1], 9);
C4AulFunc * fn = Pars[0].getFunction();
if (!fn)
fn = _this->GetFunc(Pars[0].getStr());
C4String * name;
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] == '~')
{
fn = _this->GetFunc(&s[1]);