• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Slight problem Removing Items

Status
Not open for further replies.
Level 9
Joined
Jun 7, 2008
Messages
440
I've been trying to remove my items that I have dropped. It ends up being removed from the inventory. But it is not removed from game play. I have no idea whats going wrong. Here's what I have:
JASS:
loop
        if ( GetItemTypeId(UnitItemInSlot(u, index)) == 'I00L' ) then
            call UnitRemoveItemFromSlot(u, index)
            call RemoveItem(bj_lastRemovedItem)
            set index = 7
        else
            set index = index + 1
        endif
        exitwhen index > 6
endloop
    if ( GetUnitLevel(u) == 3 ) then
        set shape = CreateItem('I01D', x, y)
        call UnitAddItem(u, shape)
            if (IsPlayerInForce(p, f)) then
                call DisplayTextToPlayer(p, 0, 0,"TRIGSTR_1444")
            endif
        set shape = null
    endif
I havent posted the intire trigger. This is the only part that i can see that would have the problem.
 
It would be:
JASS:
call RemoveItem(UnitRemoveItemFromSlot(u, index))

bj_lastRemovedItem returns null unless you have used:
JASS:
function UnitRemoveItemFromSlotSwapped takes integer itemSlot, unit whichHero returns item
    set bj_lastRemovedItem = UnitRemoveItemFromSlot(whichHero, itemSlot-1)
    return bj_lastRemovedItem
endfunction

:)
 
Status
Not open for further replies.
Top