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.
Fixed an issue that caused the game to crash in O2 builds when the map was turned on. From the comments: