# HG changeset patch # User Wuzzy # Date 1530981441 -7200 # Node ID 93ba1826b8c25f0750bf4f54cc10314dd406a2f7 # Parent dd2e51f7303d708cbb2fc23c0407281db95e3db6 Fix rare Lua error message spam in Space Invasion diff -r dd2e51f7303d -r 93ba1826b8c2 ChangeLog.txt --- a/ChangeLog.txt Fri Jul 06 17:16:01 2018 +0200 +++ b/ChangeLog.txt Sat Jul 07 18:37:21 2018 +0200 @@ -22,6 +22,9 @@ * Don't play “Missed” and “Laugh” taunt when those don't make sense * Fix retreat timer not turning red for some weapons +Space Invation: + * Fix rare Lua error message spam at end of game + Lua API: + New call: Retreat(time [, respectGetAwayTimeFactor): Force current turn into retreating mode + New call: GetAmmoTimer(gearUid, ammoType): Returns current set timer for given ammoType and hog gear in ms. Returns nil for non-timerable ammo diff -r dd2e51f7303d -r 93ba1826b8c2 share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua Fri Jul 06 17:16:01 2018 +0200 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua Sat Jul 07 18:37:21 2018 +0200 @@ -2183,7 +2183,7 @@ end -- if player is hit by circle bazooka - elseif (GetGearType(gear) == gtShell) then + elseif (GetGearType(gear) == gtShell) and (CurrentHedgehog ~= nil) then dist = GetDistFromGearToGear(gear, CurrentHedgehog) @@ -2223,6 +2223,9 @@ -- collision detection for player entering a circle function CheckDistances() + if not CurrentHedgehog then + return + end --nw WriteLnToConsole("Start of CheckDistances()") for i = 0,(vCCount-1) do