Skip to content

Commit 3355f6b

Browse files
committed
saner frameskip logic
1 parent d43fb3a commit 3355f6b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

docs/dev/Lua API.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6566,7 +6566,7 @@ Functions
65666566
* ``setAnimationInfo(workshop_type, frames, frame_skip)``
65676567

65686568
Animate workshop by replacing displayed tiles (or graphical tiles). There are two ways this works:
6569-
if ``frame_skip>=0`` then it shows each frame for ``frame_skip`` of frames or if ``frame_skip<0``
6569+
if ``frame_skip>0`` then it shows each frame for ``frame_skip`` of frames or if ``frame_skip<=0``
65706570
Frames are synchronized with the machines this building is connected to.
65716571

65726572
:workshop_type: custom workshop string id, e.g. ``SOAPMAKER`` or numeric id

plugins/building-hacks.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,7 @@ static int setAnimationInfo(lua_State* L)
539539
//animation
540540
loadFrames(L, def, 2);
541541
def.frame_skip = luaL_optinteger(L, 3, -1);
542-
if (def.frame_skip == 0)
543-
def.frame_skip = 1;
544-
if (def.frame_skip < 0)
542+
if (def.frame_skip <= 0)
545543
def.machine_timing = true;
546544
else
547545
def.machine_timing = false;

0 commit comments

Comments
 (0)