1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-26 01:35:21 +03:00

Missing check in setGlobalVariable(...)

This commit is contained in:
bsongis 2014-05-05 14:51:22 +02:00
parent c53fbd9e94
commit 6ae7da4b1a
2 changed files with 2 additions and 2 deletions

View file

@ -758,7 +758,7 @@ static int luaModelSetGlobalVariable(lua_State *L)
int idx = luaL_checkunsigned(L, 1);
int phase = luaL_checkunsigned(L, 2);
int value = luaL_checkinteger(L, 3);
if (phase < MAX_PHASES && idx < MAX_GVARS && value <= 500) {
if (phase < MAX_PHASES && idx < MAX_GVARS && value >= -GVAR_LIMIT && value <= GVAR_LIMIT) {
g_model.phaseData[phase].gvars[idx] = value;
}
return 0;