• 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.

[Trigger] TriggerRegisterPlayerStateEvent --> PLAYER_STATE_RESOURCE_GOLD verbuggt?

Status
Not open for further replies.
Level 13
Joined
Mar 19, 2010
Messages
870
Hallo hivers,

i've found a bug in the events of wc3. I gave a player every x sekundes gold to his current gold and when you want to react to this without doing any action the event leaks :)

Check the map and activate/deactivate the "Gold Income Event" Trigger and take a look at the Handle Counter and your war3.exe in the task manager!!!

Workaround? Maybe save the gold every second and compare it with the current. If something has changed you can calculate the difference and you can do what ever you want... BUT WHY is the event bugged? grrr

Reg.
Patrick

edit: For Lumber is it the same... both events leaks???
 

Attachments

  • Gold_and_Lumber_Events_leaks.w3x
    11.6 KB · Views: 62
Last edited:
This may shed some light on the issue. I can't test all too often so I haven't been able to get back to it, but I assume this would be related to the problem:
d07.RiV said:
How triggers work: when a trigger is activated (not by TriggerExecute/evaluate, but by an event) a handle is created. I have no idea what is stored in that handle. It gets removed after the trigger finishes execution. If you destroy the trigger during execution (in actions, removing it in conditions would crash the tread), it releases handles associated with the trigger including this handle, and after a triggersleepaction apparently wc3 sees that the trigger has finished execution (since it no longer exists) and releases this handle again, so it gets added to the triggerstack twice, and next 2 allocated objects would get the same handle.
Source

It may just take a while to recycle. In a realistic setting, there probably won't be any problems.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,255
Periodic poll (10 times a second) with some intelligence so that it can tell if multiple gold miners/lumberjacks dropped resources in that time. All triggered income sources could be done using a custom function that executes triggers attached to the custom income system. Even still it might have problem with resource expenditure.
 
Status
Not open for further replies.
Top