How to reveal a rect/region?

Level 15
Joined
Aug 7, 2013
Messages
1,337
Hi,

What is the native to reveal a rect/region to the player, e.g. they have vision of that rect/region.

I tried using this call

JASS:
call SetFogStateRect(owner, FOG_OF_WAR_VISIBLE, townArea, true)

But all it did was keep the fog, except reveal that there were buildings under it.
 
Apparently the BJ does this.

JASS:
function CreateFogModifierRectBJ takes boolean enabled, player whichPlayer, fogstate whichFogState, rect r returns fogmodifier
    set bj_lastCreatedFogModifier = CreateFogModifierRect(whichPlayer, whichFogState, r, true, false)
    if enabled then
        call FogModifierStart(bj_lastCreatedFogModifier)
    endif
    return bj_lastCreatedFogModifier
endfunction

Probably FogModifiers have to be started via that call?
 
Level 15
Joined
Aug 7, 2013
Messages
1,337
Ah many thanks. But do I need to destroy the fog modifier as well (store it in a variable then call destroy)? Or does it not leak?
 
Top