mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-11-09 16:41:21 +08:00
AP_Scripting: Fix bad location changes
This commit is contained in:
1 parent
102141756a
commit
7183b504a7
1 file changed
+3
-4
@@ -219,7 +219,7 @@ static int location_distance(lua_State *L) {
|
||||
return luaL_argerror(L, args, "too many arguments");
|
||||
}
|
||||
|
||||
lua_pushnumber(L, *check_location(L, -2).get_distance(*check_location(L, -1)));
|
||||
lua_pushnumber(L, check_location(L, -2)->get_distance(*check_location(L, -1)));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -271,9 +271,8 @@ static int location_offset(lua_State *L) {
|
||||
return luaL_argerror(L, args, "too many arguments");
|
||||
}
|
||||
|
||||
*check_location(L, -3).offset(
|
||||
luaL_checknumber(L, -2),
|
||||
luaL_checknumber(L, -1));
|
||||
check_location(L, -3)->offset(luaL_checknumber(L, -2),
|
||||
luaL_checknumber(L, -1));
|
||||
|
||||
lua_pop(L, 2);
|
||||
|
||||
|
||||
Reference in new issue
Block a user