Sgqvur
FullOfUltimateTruthsAndEt ernalPrinciples, i.e shi
- Reaction score
- 62
Bribe:
1. No, because after the timer the unit's user data will already be 0.
1. Why should it? The unit is dead but it's user data is not zero.
Let me give you an example:
The example I am using is really simple, create 1 footman and 4 knights, for each I save their name and location and after the map loads
I order the knights to kill the footman. When he dies the AIDS_onDestroy method should be called but it is NOT.
But if the '==' is changed to '!=' for the above mentioned line it is called.
1. No, because after the timer the unit's user data will already be 0.
1. Why should it? The unit is dead but it's user data is not zero.
Let me give you an example:
The example I am using is really simple, create 1 footman and 4 knights, for each I save their name and location and after the map loads
I order the knights to kill the footman. When he dies the AIDS_onDestroy method should be called but it is NOT.
But if the '==' is changed to '!=' for the above mentioned line it is called.
JASS:
library aidstest uses AIDS
struct testaids extends array
string name
location l
method AIDS_onCreate takes nothing returns nothing
set name = GetUnitName(this.unit)
set l = GetUnitLoc(this.unit)
endmethod
method AIDS_onDestroy takes nothing returns nothing
call RemoveLocation(l)
call BJDebugMsg("AIDS_onDestroy called")
endmethod
static method AIDS_onInit takes nothing returns nothing
call CreateUnit(Player(0), 039;hfoo039;, 0, 0, 0)
call CreateUnit(Player(0), 039;hkni039;, 0, 0, 0)
call CreateUnit(Player(0), 039;hkni039;, 0, 0, 0)
call CreateUnit(Player(0), 039;hkni039;, 0, 0, 0)
call CreateUnit(Player(0), 039;hkni039;, 0, 0, 0)
endmethod
//! runtextmacro AIDS()
endstruct
endlibrary