Page 1 of 1

Lups unitcloaked fx error when starting unit is cloaked

Posted: 12 Aug 2016, 00:46
by Forboding Angel
Evo has dynamic cloaking based upon whether your unit is in the middle of a bunch of features that provide cover or not. The issue is that if someone starts in the middle of a bunch of features, the starting unit immediately starts to cloak. This causes this error in lups. It is only an error and doesn't actually break anything.

That said, line 161 is gibberish to me. I thought I could add some simple error handling, but in seeing line 161 I don't know how I would. Could someone help me?

Code: Select all

[f=0000000] Error: LuaRules::RunCallIn: error = 2, UnitCloaked, [Internal Lua error: Call failure] [string "LuaRules/Gadgets/lups_cloak_fx.lua"]:161: attempt to index upvalue 'Lups' (a nil value)
stack traceback:
    [string "LuaRules/Gadgets/lups_cloak_fx.lua"]:161: in function 'UnitCloaked'
    [string "LuaRules/gadgets.lua"]:1506: in function <[string "LuaRules/gadgets.lua"]:1504>
    (tail call): ?
https://github.com/EvolutionRTS/Evolution-RTS/issues/44

https://github.com/EvolutionRTS/Evoluti ... x.lua#L161

Re: Lups unitcloaked fx error when starting unit is cloaked

Posted: 12 Aug 2016, 00:50
by FLOZi
At a glance, just wrap 155 to 162 in an 'if Lups then ... end'

Re: Lups unitcloaked fx error when starting unit is cloaked

Posted: 12 Aug 2016, 02:31
by Forboding Angel
FLOZi wrote:At a glance, just wrap 155 to 162 in an 'if Lups then ... end'
This plus wrapping the statement before it did the trick.

Fixed in: https://github.com/EvolutionRTS/Evolution-RTS/issues/44

Issues comment thread: https://github.com/EvolutionRTS/Evolution-RTS/issues/44

I would commit upstream, but apparently JK doesn't deem it necessary to keep the base up to date :roll: