← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/bug-1543001-eris into lp:widelands

 

Regarding the "number has no integer representation" error: Since Lua 5.3 added integer support, luaL_checkinteger does not seem to accept floating-point numbers anymore. We need to make sure to pass integers from Lua where required.

These changes seem to do the trick:

=== modified file 'data/scripting/ui.lua'
--- data/scripting/ui.lua	2016-01-28 05:24:34 +0000
+++ data/scripting/ui.lua	2016-04-09 01:25:31 +0000
@@ -99,8 +99,8 @@
    wl.Game().desired_speed = 1000
 
    for idx,p in ipairs(points) do
-      mv.viewpoint_x = p.x
-      mv.viewpoint_y = p.y
+      mv.viewpoint_x = math.floor(p.x)
+      mv.viewpoint_y = math.floor(p.y)
 
       sleep(dt)
    end
@@ -196,8 +196,8 @@
    wl.Game().desired_speed = 1000
 
    for idx,p in ipairs(points) do
-      mv.mouse_position_x = p.x
-      mv.mouse_position_y = p.y
+      mv.mouse_position_x = math.floor(p.x)
+      mv.mouse_position_y = math.floor(p.y)
 
       sleep(dt)
    end
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1543001-eris/+merge/291294
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1543001-eris into lp:widelands.


References