Shooters hidden in holes etc are revealed if in airlos. This is currently done by checking if it is in airlos and setting los bitmasks.
|
local aLos = Spring.IsPosInAirLos(x, 0, z, allyTeamID) |
|
local los = Spring.IsPosInLos(x, 0, z, allyTeamID) |
|
|
|
-- Don't reveal units which are already in LOS. Waste of time to do so. |
|
if aLos and not los then |
|
if buildRevealUnitDef[unitDefID] or (noDecloakUnits[unitDefID] and Spring.GetUnitIsCloaked(unitID)) then |
|
return |
|
end |
|
revealedUnits[allyTeamID][unitID] = immobileUnits[unitDefID] and STATIC_SHOW_TIME or MOBILE_SHOW_TIME |
|
Spring.SetUnitLosMask(unitID, allyTeamID, 15) -- Prevents engine slow update from modifying state. |
|
Spring.SetUnitLosState(unitID, allyTeamID, 15) -- Sets the unit to be fully visible. |
Spring.SetUnitUseAirlos(unitID, bool) now exists, consider simplifying the above.
Shooters hidden in holes etc are revealed if in airlos. This is currently done by checking if it is in airlos and setting los bitmasks.
Zero-K/LuaRules/Gadgets/unit_show_shooter.lua
Lines 86 to 96 in 93093e0
Spring.SetUnitUseAirlos(unitID, bool)now exists, consider simplifying the above.