Issue 2447, 2249, 2450: Null reference excpetion on overland map

Topics: Developer Forum
Aug 24, 2006 at 3:09 AM
Cullen reported these bugs. Upon investigation, this is what I determined:

This excpetion is caused by the user performing actions that cannot be done on the overland map that should not be allowed.

Currently the code in ther Main.vb module that handles the keypress for hero actions is one big select case statement, allowing the hero to perform any action at any time (except for being asleep).

I propose that this be broken up into to seperate select case statements. One being bound by an if statement that prevents the user from doing stuff on the overland map that is not allowed IE:

if not m_Hero.Overland
select case with only actions that cannot be performed on the overland map such as searching, and other things reported by Cullen
end if
select case for actions allowed to be performed anywhere

If I have time, I will try to complete the necessary changes by friday and post them on issue 2450
Aug 25, 2006 at 4:55 AM
I suggest a different approach to fixing these bugs (much like the changes I submitted, strangely enough). My thinking is that we may eventually add the ability to perform these actions in the overland (overland combat and hidden items, anyone?).

My submitted fixes include checks around the accessing of the level array, to check for the null condition. This way, if we later promote the overland to a full-on level, the changes are minimal to enable all of the possible actions; all we'll have to do is populate the m_arrLevel with values that pertain to the overland.
Aug 25, 2006 at 3:05 PM

I think that would work. The only thing I'm not sure is if anything will ever happen on the overland map.

Will acutal combat happen on the map, or will we make it like ADOM, where every square on the overland map can be entered with > like going down stairs. So when combat happens on the overland map, it changes to a zoomed in version of the overland map, so that the user "isnt on" the overland map, but in a mini level
Aug 25, 2006 at 3:24 PM
Actually, you can already zoom into a wilderness map (using '>') from the overland map. Try it, seriously... :)

There are no encounters on the overland YET, but it's high on my list. The plan is to zoom in to the wilderness map if you hit a random encounter.