• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Removing items with 0 life is bugged

Status
Not open for further replies.
Level 9
Joined
Jul 20, 2018
Messages
176
If an item has 0 life and then is removed, it is still can be picked with EnumItemsInRect. If the life is not zero, then an item removes properly. This affects both 1.26 and 1.32.9.

But there is a difference if one changes the life of an item to some non-zero value after the item is removed with 0 life:
1.26: item still can be picked with EnumItemsInRect till removed.
1.32.9: item cannot be picked.

Test map.

I suggest such fix to the function in Lua:
Lua:
do
  local RealRemoveItem = RemoveItem
  RemoveItem = function(itm)
    SetWidgetLife(itm, 1.)
    RealRemoveItem(itm)
  end
end

How to make Lua code block?
 

Attachments

  • TestRemoveItemWith0Life.w3x
    8.6 KB · Views: 27
Last edited:
Status
Not open for further replies.
Top