Merge pull request #61 from zeromus/getinteger-from-bool

support sq_getinteger() for bools
This commit is contained in:
Alberto Demichelis 2016-06-24 23:17:32 +08:00 committed by GitHub
commit f7cf119db7

View File

@ -657,6 +657,10 @@ SQRESULT sq_getinteger(HSQUIRRELVM v,SQInteger idx,SQInteger *i)
*i = tointeger(o);
return SQ_OK;
}
if(sq_isbool(o)) {
*i = SQVM::IsFalse(o)?SQFalse:SQTrue;
return SQ_OK;
}
return SQ_ERROR;
}