- Joined
- Aug 21, 2008
- Messages
- 533
Just started using hashtables but suddenly trigger doesnt works anymore...
The trigger works till the unit is created, the following lines arent working
JASS:
function Trig_Schootimg_Actions takes nothing returns nothing
local unit u
local unit u2
local real r
local real r2
local location l
local location l2
set u = GetEventDamageSource()
if ( not ( IsUnitType(u, UNIT_TYPE_RANGED_ATTACKER) == false) ) then
set u2 = GetTriggerUnit()
set l = GetUnitLoc(u)
set l2 = GetUnitLoc(u2)
set r2 = AngleBetweenPoints(l,l2)
//set r = LoadRealBJ(StringHashBJ("misslespeed"), StringHashBJ(GetUnitName(GetEventDamageSource())), udg_hashTable)
call CreateUnitAtLoc(GetOwningPlayer(u),LoadIntegerBJ((StringHashBJ("missle")), StringHashBJ(GetUnitName(GetEventDamageSource())), udg_hashTable),l,r2)
set u = GetLastCreatedUnit()
call DisplayTextToForce( GetPlayersAll(), GetUnitName(u) )
call GroupAddUnit(udg_misslegroup,u)
call SaveRealBJ( r, StringHash("missleangle"), GetHandleId(u), udg_hashTable )
call SaveRealBJ( 2.10, StringHash("time"), GetHandleId(u), udg_hashTable )
endif
set u = null
endfunction
//===========================================================================
function InitTrig_Schootimg takes nothing returns nothing
set gg_trg_Schootimg = CreateTrigger( )
call TriggerAddAction( gg_trg_Schootimg, function Trig_Schootimg_Actions )
endfunction
The trigger works till the unit is created, the following lines arent working