support sq_getinteger() for bools (returns SQFalse or SQTrue in the SQInteger). Useful for format("%d",mybool)
This commit is contained in:
parent
26ef4c4f5e
commit
98b5cc434d
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user