# HG changeset patch # User Wuzzy # Date 1519029936 -3600 # Node ID 91f23558c936cc0d2c1ab1578537165093b4bdee # Parent bef97cc310b027b928e7851bba31a50cf329399c Lua library Animate: StoppedGear now returns true if gear does not exist Fixes Lua error spam in ACF1 when Leaks a Lot drows diff -r bef97cc310b0 -r 91f23558c936 ChangeLog.txt --- a/ChangeLog.txt Sat Feb 17 20:59:56 2018 +0100 +++ b/ChangeLog.txt Mon Feb 19 09:45:36 2018 +0100 @@ -53,6 +53,7 @@ A Classic Fairytale: + Mission 3: Display number of turns left at timed parcours * Fix incorrect storytelling in mission descriptions + * Mission 1: Fix error message spam when Leaks a Lot drowns Theme customization: + Add fallback music with fallback-music and fallback-sd-music diff -r bef97cc310b0 -r 91f23558c936 share/hedgewars/Data/Scripts/Animate.lua --- a/share/hedgewars/Data/Scripts/Animate.lua Sat Feb 17 20:59:56 2018 +0100 +++ b/share/hedgewars/Data/Scripts/Animate.lua Mon Feb 19 09:45:36 2018 +0100 @@ -425,6 +425,11 @@ -------------------------------------Misc--------------------------------- function StoppedGear(gear) + -- GetHealth returns nil if gear does not exist + if not GetHealth(gear) then + -- We consider the gear to be “stopped” if it has been destroyed + return true + end dx,dy = GetGearVelocity(gear) return math.abs(dx) <= 1 and math.abs(dy) <= 1 end