• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

SetBlight Desync Issues

Level 5
Joined
Jan 5, 2017
Messages
9
I haven't seen anyone post about this but thanks to the guys working on W3CE it's been revealed that the SetBlight native has a major problem: it will remove blight (regardless of the value of the addBlight argument) for any player that is holding down the shift key. This can easily cause a desync.

Link to conversation

The solution is to use the other natives, which aren't affected by the shift key:
JASS:
native SetBlightRect takes player whichPlayer, rect r, boolean addBlight returns nothing
native SetBlightPoint takes player whichPlayer, real x, real y, boolean addBlight returns nothing
native SetBlightLoc takes player whichPlayer, location whichLocation, real radius, boolean addBlight returns nothing

Abilities that create blight, such as the Sacrificial Skull and Undead building creation, also don't suffer from the issue.
 

LeP

LeP

Level 13
Joined
Feb 13, 2008
Messages
539
Interesting. Has this always been there or just in recent patches?
Do you fancy writing a PR for my jassdoc as i'm not really into discord. Also i cannot recreate this in singleplayer so mp only effect?
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Can neither reconstruct it in singleplayer nor multiplayer using SetBlight(Player(0), 0, 0, 512, true).

But in the World Editor, in the terrain editor, you can invert the effect of placing Blight, placing Boundary or removing Boundary by holding left or right shift (regardless of capslock).

Also with SetTerrainType(0, 0, 'NOTH', 0, 3, 0), you can place boundary or remove boundary when holding left or right shift (regardless of capslock) ingame both in singleplayer and multiplayer, but it's only a graphical overlay without changes to pathing.
 
Level 19
Joined
Jan 3, 2022
Messages
320
The SetBlight comment was mistaken, the discussion evolved into why the SHIFT check is there. I tested SetBlight in 1.27 and 1.36. NOT AFFECTED BY SHIFT.
Instead SetTerrainType(0, 0, FourCC('NOTH'), 0,5,1) is affected by the SHIFT key. Water explained above.

Detailed explanation in jassdoc issue
PS: It'd be great if you removed the desync tag and changed the title @SwissDerd
 
Top