Priority
--------
FIXME: WH1 randomly and inappropriately resetting sound/music volume
FIXME: Make the Caps Lock code use shift state instead of scan code (should fix capslock-run problems?) (See game programming gurus book)
FIXME: Try to fix flicker when using fists (like the already-fixed dual wield flicker) - happens in WH2.EXE too
TODO: permanentwritesprite and overwritesprite are wrapper functions for rotatesprite and could probably
      be got rid of.  Probably worth referring to BUILD.TXT regarding this. (overwritesprite is done for EGWH2 now).
TODO: Make a custom SETUP utility.  Unfortunately the code to the Witchaven II one wasn't released, but one does
         come with the original Witchaven code.  The config format seems as if it may be different, though.
		 Alternately, I might implement a text-based config file.
TODO: Investigate occasional WH1 hard crashes if any still remain (possible memory corruption?)
TODO: Look at implementing the WH1 fire resistance palette effect in WH2.


Stuff to do when upgrading BUILD version
----------------------------------------
TODO: Boost visible sprite limit if possible (internal to BUILD)


Modding feature TODOs (lower priority)
--------------------------------------
TODO: Add MAPCOMPAT switch to disable some fixes that might interfere with maps designed for the vanilla engine?
TODO: GAME parameter, things that need to be updated:
      - WHNET.C > MAXARGS (to make arg be found)          Done
      - WHNET.C > argparm (for parameter name)            Done
      - WHNET.C > netcheckargs (to handle parameter)      Done
      - WHMENU.C > startnewgame (for the .MAP files)      Done
      - WHPLR.C > loadnewlevel (for the .MAP files)       Done
      - WHAVEN.C > STUFF.DAT (for packed data)            Done
      - WHSNDMOD.C > JOESND, F_SONGS, W_SONGS (Audio)     Done
      - WHAVEN.C > LOOKUP.DAT                             Done (Might have problems as other .DATs are not done)
      - WHMENU.C > loadgame (for save games)              TODO
      - WHMENU.C > savedgamename (for save games)         TODO
	  - WHSMK.C > Smacker videos                      TODO (Modder might want custom intro/outro vids)
      - WHAVEN.C > .ART files                             Problematic (Attempting this made game crash, pack
                                                             them in a STUFF.DAT instead)
      - Wherever game behavior def loading is done        TODO
      - PALETTE.DAT, etc.                                 SHOULD BE LOADING IN BUILD INTERNAL. WHY DOESN'T IT?
                                                          (Possibly the version of BUILD used for WH2 did not have
                                                           finished STUFF.DAT support yet?)
TODO: Externalize map titles to a configurable file (Currently in WHSMK.C)
         Tried this, but the program would sometimes not be able to access the file.
         Could it be as simple as having forgotten to fclose?
         Filed for later at any rate.
TODO: Game behavior mod patches.
TODO: Make automatic health configurable according to skill level in mod configuration file
TODO: WHSMK.C function smkplayseq might be retooled to accept a file name directly instead of an index into
       a filename array.  Possibly do something about the end-of-level stat part too.

	   
Possible MAP issues:
- WH1 LEVEL10 - might need an additional stop-loop trigger for teleporting out of the water area
- WH1 LEVEL11 - Is the entrance to the exit-area supposed to lower? (no sign of tagging except on the interior of said area)
- WH! LEVEL13 - The bow is not gettable?
- WH1 LEVEL13 - Is a pillar in the pentagram area supposed to lower? (Yes, there's a pull chain - but you can get permastuck otherwise)

Other stuff to check/consider
-----------------------------
CHECK:  Some wall-decal sprites are clipped off in WH1.  This problem appeared in the v1.1 versions of vanilla WH1 and may be the result
         of an internal BUILD change.  It might be necessary to patch the map data instead.
TODO: Make an alternate intermission screen for when the STAIRS.SMK isn't found?
CHECK: Should Guardian be freezable with Ice Razor?
FIXED?: Enchanted weapons lose their sound before enchantment is gone
CHECK: Generally more fully investigate the special WHOBJ.C functions
CONSIDER: Don't give XP when freezing monsters, give xp when breaking frozen monsters? (Default behavior is exploitable to gain excess XP)
CONSIDER: Possibly look into adding more door types to the Open Doors spell (WHPLR.C, look for case 7 KNOCKSPELL)

DONE: Make a debug run of the engine that will output all results of the broken krand functions so we can
         better know how the game is misbehaving in these circumstances.
      Result - there is nothing wrong with krand(), nor with using the & operator with it.  The mistake
         that caused bugs with it was incorrect understanding of C's order of operations.


Fixed, but keep an eye on them for possible tweaking:
-----------------------------------------------------
- Knockback from melee attacks can make the player spin like crazy (e.g. Argothonian sword)
    (Introduced because of player movement changes)


Notes:
------
- Look into ALLOWSCREENCAPTURE/screencapture function -- ALLOWSCREENCAPTURE is not by default defined.
      Only relevant to Smacker playback; otherwise screencapture is allowed anyway.
- Purpose of playsound_loc (WHSNDMOD.C)?
      Also unused it seems.
- What does checkheat do?
      Unused, never called in WH2 and called only from a disabled block in WHANI.C of WH1 for an object called HEATSEEKER.
- What's STARMAP tile for? -- Apparently nothing; the name's defined but not used in the code.
- Is SNDNAMES.H used? -- No.
- spr->clipdist values for various beings, especially skeletons (pass through wall bug)?
      It's 64, and given << 2 when passed to clipmove (so 256).  Not too small, but maybe too big? (Ken recommends 128 in the build docs)
      It might also be well to check if there's any point where the size passed to clipmove suddenly changes (something Ken explicitly warns
      not to do).
      Clipmove is called once in WHINP.C (processinput) to move the player, and once in WHOBJ.C (movesprite; also actormovesprite but that is unused.)
- Check if enchanted sound handle is getting mangled in sound priority code?
      No.  Priority specifically ignores "loop forever" sounds when deciding on a sound to kill.
- swingdapunch function in WHPLR.C could probably be expanded to make walls that do something when hit with a weapon (like certain triggers in
  other games) if such a function were desired.


Weird stuff that I don't understand the cause of, so can't fix currently (but may at my leisure):
-------------------------------------------------------------------------
- Ambient sound loops don't work despite my efforts to re-enable them. (WH2)
- See if anything can be done about "die when hit wall" bug (probably not for now)
- Hard to take leather armor in level 1 (the one in the skull's nose)
- Archers not hitting player (only in The Horror Back?  Something with the maps?) -- may be an unrepeatable glitch
- Can sometimes walk through a monster (related also to missed hits??)
- Argothonian with sword hit detection (in a test map he's completely normal, in actual play it sometimes
     seems like his hitbox is displaced vertically so you have to hit his face to hurt him... I also
     didn't find anything different about how they're placed in maps where there can be issues).
     Starting as KURTKNEE doesn't seem to have anything to do with it, either.
- Strange autoaim selection (aims to the sides) - based on cansee which seems to be a BUILD internal?
- How does lava fiend get into the skull eye socket on level 1?
