Page 1 of 1

Help please! Gadget is interfering with stealth=true,

Posted: 19 Aug 2011, 07:49
by Forboding Angel
This gadget:
https://code.google.com/p/evolutionrts/ ... _cover.lua

For whatever reason, renders stealth=true, in unitdefs to be completely not working, however, the gadget itself works perfectly. Units scurry under trees and get stealth + cloak.

Can someone please help me fix it (or fix it for me?)? Thank you!

Re: Help please! Gadget is interfering with stealth=true,

Posted: 19 Aug 2011, 09:09
by Niobium
Replace:

Code: Select all

function unhideUnit (uID)
    Spring.SetUnitCloak (uID, false ,2)
    Spring.SetUnitStealth (uID, false)
end
With:

Code: Select all

function unhideUnit (uID)
    Spring.SetUnitCloak (uID, false ,2)
    if not UnitDefs[Spring.GetUnitDefID(uID)].stealth then
        Spring.SetUnitStealth (uID, false)
    end
end
Note: Untested

Re: Help please! Gadget is interfering with stealth=true,

Posted: 19 Aug 2011, 10:22
by Forboding Angel
Yep, that did the trick. Thanks nio :-)

I'm not sure if I every thanked you for the little gadget I was working on for destroying trees under buildings etc, but, thanks for that too

:mrgreen: