- Joined
- Dec 2, 2016
- Messages
- 733
The below function runs when an item is dropped, I'm trying to check if the last dropped item is inside the rect "Grave_Site"
'1' message runs but not the 2nd message. I'm droping an item right inside the rect though, is this not how you detect a dropped item using 'GetLastRemovedItem()' ?
Thanks.
'1' message runs but not the 2nd message. I'm droping an item right inside the rect though, is this not how you detect a dropped item using 'GetLastRemovedItem()' ?
Thanks.
JASS:
function onDrop takes nothing returns nothing
local item lastItem = GetLastRemovedItem()
call DisplayTextToForce(GetPlayersAll(),"1")
if (RectContainsItem(lastItem, gg_rct_Grave_Site) == true ) then
call DisplayTextToForce(GetPlayersAll(),"2")
endif
endfunction
function InitTrig_unitDropsItem takes nothing returns nothing
set gg_trg_unitDropsItem = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( gg_trg_unitDropsItem, EVENT_PLAYER_UNIT_DROP_ITEM )
call TriggerAddAction(gg_trg_unitDropsItem , function onDrop )
endfunction