planqi / slashdiablo-maphack

A customized maphack for the slashdiablo D2 server
GNU Affero General Public License v3.0
88 stars 42 forks source link

Feature/fix o2 map load crash #24

Closed youbetterdont closed 5 years ago

youbetterdont commented 5 years ago

Fixed an issue that caused the game to crash in O2 builds when the map was turned on. From the comments:

The call to GetLevelName somehow invalidates pUnit. This is only observable in O2 builds. The game will crash when you attempt to open the map (which calls OnAutomapDraw function). We need to get the player unit again after calling this function. It may be a good idea in general not to store the return value of GetPlayerUnit.

youbetterdont commented 5 years ago

closing this since it also contains the price condition "fix"