1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-13 11:29:51 +03:00

LUA trimSource is now a positive value

This commit is contained in:
3djc 2023-01-06 09:12:30 +01:00
parent 29037d444d
commit 5b3e1288a2

View file

@ -531,8 +531,8 @@ Return input data for given input and line number
* `switch` (number) input switch index * `switch` (number) input switch index
* `curveType` (number) curve type (function, expo, custom curve) * `curveType` (number) curve type (function, expo, custom curve)
* `curveValue` (number) curve index * `curveValue` (number) curve index
* `carryTrim` deprecated, please use trimSource instead * `carryTrim` deprecated, please use trimSource instead. WARNING: carryTrim was getting negative values (carryTrim = - trimSource)
* 'trimSource' (number) a NEGATIVE number representing trim source * 'trimSource' (number) a positive number representing trim source
* 'flightModes' (number) bit-mask of active flight modes * 'flightModes' (number) bit-mask of active flight modes
@status current Introduced in 2.0.0, curveType/curveValue/carryTrim added in 2.3, inputName added 2.3.10, flighmode reworked in 2.3.11, carryTrim replaced by trimSource in 2.3.16 @status current Introduced in 2.0.0, curveType/curveValue/carryTrim added in 2.3, inputName added 2.3.10, flighmode reworked in 2.3.11, carryTrim replaced by trimSource in 2.3.16
@ -555,7 +555,7 @@ static int luaModelGetInput(lua_State *L)
lua_pushtableinteger(L, "curveType", expo->curve.type); lua_pushtableinteger(L, "curveType", expo->curve.type);
lua_pushtableinteger(L, "curveValue", expo->curve.value); lua_pushtableinteger(L, "curveValue", expo->curve.value);
lua_pushtableinteger(L, "carryTrim", expo->trimSource); lua_pushtableinteger(L, "carryTrim", expo->trimSource);
lua_pushtableinteger(L, "trimSource", expo->trimSource); lua_pushtableinteger(L, "trimSource", - expo->trimSource);
lua_pushtableinteger(L, "flightModes", expo->flightModes); lua_pushtableinteger(L, "flightModes", expo->flightModes);
} }
else { else {
@ -624,7 +624,7 @@ static int luaModelInsertInput(lua_State *L)
expo->trimSource = luaL_checkinteger(L, -1); expo->trimSource = luaL_checkinteger(L, -1);
} }
else if (!strcmp(key, "trimSource")) { else if (!strcmp(key, "trimSource")) {
expo->trimSource = luaL_checkinteger(L, -1); expo->trimSource = - luaL_checkinteger(L, -1);
} }
else if (!strcmp(key, "flightModes")) { else if (!strcmp(key, "flightModes")) {
expo->flightModes = luaL_checkinteger(L, -1); expo->flightModes = luaL_checkinteger(L, -1);