support sq_getinteger() for bools (returns SQFalse or SQTrue in the SQInteger). Useful for format("%d",mybool)

This commit is contained in:
zeromus 2016-06-19 18:48:01 -05:00
parent 26ef4c4f5e
commit 98b5cc434d

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;
}