Norbyte / ositools

Advanced scripting and mod support for Divinity Original Sin 2
MIT License
376 stars 30 forks source link

Game.Tooltip item comparisons pass the wrong equipped EclItem #72

Open PinewoodPip opened 2 years ago

PinewoodPip commented 2 years ago

Looks like during item comparisons, the listeners are being passed the item that the owner of the item you're hovering over is wearing, rather than the equipped item of the currently selected char

Easier-to-understand example:

  1. Red Prince is wearing amulet X
  2. Sebille is wearing amulet Y
  3. Sebille hovers over amulet Z in Red Prince's inventory
  4. Tooltips are created for item Z and Y, but the Game.Tooltip listeners receive items Z and X - in other words, it's as if Red Prince was comparing the item

Same thing happens with offhand comparisons, the item owner's equipped offhand is passed, not the offhand of the character looking at the tooltip here I'm printing the names of the passed EclItems in a tooltip listener; you can see that the item being hovered over is right ("Falcon's Eye") but the equipped item is not correct - it's the amulet being worn by the character that has Falcon's Eye in his inventory

The issue stems from here. Replacing the GetPlayerHandle call with ex. one from statusConsole fixes the issue.