• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Would this cause a desync?

Status
Not open for further replies.
Level 4
Joined
Jun 16, 2012
Messages
25
1707285904444.png

context: Player 10 (Light Blue) is npc. His heroes have the shop sharing ability, allowing other players to use the "Pick Hero" custom ability which selects that hero.

wanted to know if this slop would cause a desync.
 

Remixer

Map Reviewer
Level 33
Joined
Feb 19, 2011
Messages
2,112
Changing unit ownership to a local player can cause a desync if you're not checking factors that are in sync. The lack of conditions in the trigger is very weird though. You are changing the ownership of the unit to the local player without defining who the local player is? What are you trying to achieve here, why do you use the local player? Also, it's not very good practice to name your variables "GetLocalPlayer", why don't you name it "LocalPlayer" instead for example? Note that even if you set your "udg_GetLocalPlayer" to the local player the reference itself is not to the actual local player, but the variable itself, so it becomes very misleading to name your triggers along with the functions you use to define them, as those may change.
 
Level 4
Joined
Jun 16, 2012
Messages
25
Changing unit ownership to a local player can cause a desync if you're not checking factors that are in sync.
word

To test it, you can launch any number of clients through the BNET app and play LAN with yourself. Just make sure that after launching the second client you immediately return to the first client and click "Play Offline" - it may take a moment to appear. I think if you wait too long then it will cause problems and you'll have to exit out and try again.
found a way to test it too and ended up fixing it
 
Status
Not open for further replies.
Top