Cohadar
master of fugue
- Reaction score
- 209
Actually if you answer my last question you will find out that you are wrong about that.
CSData does not need a Clear function, which is why it does not exist.
TheDamien said:Just about all (integer) attachment systems do exactly the same thing in different ways. The only difference between ABC and any other, where the user should be concerned, is that ABC forces you to use a different function for each handle-type.
Riiiiiight.
And what happens when you use CSData to attach to units?
You need to check for previous attachments remember?
And if spell that attaches to units does not clear attachments after it is finished,
what happens then?
So let me answer that question for you:
Clear functions from ABC have a return value
ClearTriggerStructA would be roughly equivalent to:
GetCSData(<handle>) + SetCSData(<handle>, 0)
How many jass newbies are going to figure that out by themselves?
And how many jass newbies in the first place would know all steps needed to make spell MUI with CSData?
You still think that way?
This is a bit of a moot point, as ABC can not attach to units at all, but with CSData you would simply set the value to 0. If the value is equal to 0, then the data has not been set or has been previously "cleared".
function TimerAction takes nothing returns nothing
local timer t = GetExpiredTimer()
local Data data = ClearTimerStructA(t)
//.....
endfunction
function TimerAction takes nothing returns nothing
local timer t = GetExpiredTimer()
local Data data = GetCSData(t)
call SetCSData(t, 0)
//.....
endfunction