- Joined
- Aug 30, 2009
- Messages
- 114
Hello guys, its been a while since my last post.
So, I was testing my map out with some friends, and I found many crashes, and all with abilities that give "dummy" abilities to units! The easiest example I can give you guys is this ability:
Every attack given by an unit with the A0T6 ability causes the attacked to loose armor for a few seconds based upon the level of the ability.
Note: That "CustomWait" function is a simple optimized PolledWait I made, which has no leaks. The crash has nothing to do with this function since I use it everywhere and I had absolutely no problem with it so far.
The problem is: The spell works perfectly fine, but if the enemy dies and the duration expires, the game crashes.
So, my question is the following: Does change ability level of dead units crash the game or the source of my problem must be somewhere else ???
Thanks guys.
So, I was testing my map out with some friends, and I found many crashes, and all with abilities that give "dummy" abilities to units! The easiest example I can give you guys is this ability:
Every attack given by an unit with the A0T6 ability causes the attacked to loose armor for a few seconds based upon the level of the ability.
JASS:
private function Conditions takes nothing returns boolean
return GetUnitAbilityLevel(GetAttacker(), 'A0T6') > 0
endfunction
private function Actions takes nothing returns nothing
local unit U = GetAttacker()
local unit T = GetTriggerUnit()
local integer Lv = GetUnitAbilityLevel(U, 'A0T6')
local integer Stacks = GetUnitAbilityLevel(T, 'A0T7')
local real Wait = 3 + (2 * Lv)
if Stacks == 0 then
call UnitAddAbility(T, 'A0T7')
else
call IncUnitAbilityLevel(T, 'A0T7')
endif
call CustomWait(Wait)
if (GetUnitAbilityLevel(T, 'A0T7') == 1 then
call UnitRemoveAbility(T, 'A0T7')
else
call DecUnitAbilityLevel(T, 'A0T7')
endif
set U = null
set T = null
endfunction
Note: That "CustomWait" function is a simple optimized PolledWait I made, which has no leaks. The crash has nothing to do with this function since I use it everywhere and I had absolutely no problem with it so far.
The problem is: The spell works perfectly fine, but if the enemy dies and the duration expires, the game crashes.
So, my question is the following: Does change ability level of dead units crash the game or the source of my problem must be somewhere else ???
Thanks guys.