Project-Diablo-2 / BH

A modified version of slashdiablo's BH for Project Diablo 2
GNU Affero General Public License v3.0
24 stars 25 forks source link

Fix map id lookup in conditions #53

Closed exiledagain closed 7 months ago

exiledagain commented 7 months ago

The new method is used by StatsDisplay::OnDraw(). Items such as tomes are not purged from the cache by mouse over.

https://github.com/Project-Diablo-2/BH/blob/db78198c4e08dc4692157efb5b618254427b632f/BH/Drawing/Stats/StatsDisplay.cpp#L364

weili0677 commented 7 months ago

I think this code "int map_id = (int)player->pPath->pRoom1->pRoom2->pLevel->dwLevelNo;" is correct. and the "**Var_D2CLIENT_MapId();" when you go to other area with waypoint and back then the MapId will not change.

exiledagain commented 7 months ago

This issue was reported in discord. Using the stash with the previous code resulted it the wrong map id. I confirmed this via debugger. The map id is changing for me using the Horadric Cube and an assortment of items but not tomes. In the case of tomes, no properties interception was called to purge it from the cache.

https://discord.com/channels/701658302085595158/771820538502971402/1230986515405082776

https://github.com/Project-Diablo-2/BH/blob/db78198c4e08dc4692157efb5b618254427b632f/BH/Modules/Item/Item.cpp#L1393

weili0677 commented 7 months ago

This issue was reported in discord. Using the stash with the previous code resulted it the wrong map id. I confirmed this via debugger. The map id is changing for me using the Horadric Cube and an assortment of items but not tomes. In the case of tomes, no properties interception was called to purge it from the cache.此问题已在 discord 中报告。将存储与前面的代码一起使用会导致它错误的地图 ID。我通过调试器确认了这一点。使用 Horadric Cube 和各种物品而不是书籍,地图 ID 正在为我更改。对于 tomes,没有调用属性拦截来将其从缓存中清除。

https://discord.com/channels/701658302085595158/771820538502971402/1230986515405082776

https://github.com/Project-Diablo-2/BH/blob/db78198c4e08dc4692157efb5b618254427b632f/BH/Modules/Item/Item.cpp#L1393

so.early season (such as season 6) the MAPID not change is the cache not clear?

fergushev commented 7 months ago

Gonna close this out. Got this fixed with 515ae38ce1addfbe035328cfd2eb0a91a9696446