HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

This has completely thrown me for a loop

07-02-2007, 11:52 PM#1
Beardo
This function

Collapse JASS:
function InvRemoveItem takes unit u, item i returns nothing   
    call UnitRemoveItem(u, i)    
endfunction 

Executes this trigger (I'm only showing the conditions cause that's all that matters)

Collapse JASS:



function antidragconditions takes nothing returns boolean
    local integer i = GetIssuedOrderId()
    local item target = GetOrderTargetItem()
    if i > 852001 and i < 852008 and IsUnitInGroup(GetOrderedUnit(), udg_unitswinventory) and GetOrderTargetItem() != UnitItemInSlot(GetOrderedUnit(), i-852002) then
        if GetItemTypeId(target) == 'I02P' or GetItemTypeId(target) == 'I02Q' or GetItemTypeId(target) == 'I02R' then      
        set target = null
        return true
        endif
    endif
    set target = null
    return false
endfunction


function BInv takes nothing returns nothing
local trigger antidrag = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(antidrag, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER)
call TriggerAddAction(antidrag, function antidragactions)
call TriggerAddCondition(antidrag, Condition(function antidragconditions))
set antidrag = null
endfunction



Am I missing something? Does UnitRemoveItem(u, i) give the unit some order I'm not aware of? Help me out here...
07-02-2007, 11:56 PM#2
Vexorian
add a message to display the id of issued order?
07-03-2007, 12:00 AM#3
Beardo
ill try it and see what comes up
07-03-2007, 12:39 AM#4
Beardo
This line right after the 'UnitRemoveItem' displays 0

Collapse JASS:
call DisplayTextToPlayer(0, 0, 0, I2S(GetIssuedOrderId()))

So does

Collapse JASS:
call DisplayTextToPlayer(Player(0),0,0,I2S(GetUnitCurrentOrder(u)))

Guessing cause they're both event responses and this (obviously) isn't a trigger.

Has anyone had this issue before?