Then refactor the code to make things like this go away?
at this point its how long to refactor vs how long to to simply complete the project with the current systems, including time wasted on typos and "forgot to edit" errors - its that close.
the refactor would basically change how location and probably orientation, collision radius, and frustum cull radius are stored for everything in the game. definitely non-trivial with 120K+ lines of game specific code. i could probably do it in 4-5 days. whereas its unlikely i'll waste another 4-5 days on similar errors before the game is done. especially since having been burned recently, i'm now back to carefully double checking that type of code when i write it.
Speaking as someone who has seen your code posted here before, the amount of time and the errors don't surprise me in the slightest...
i wasn't really that disappointed, 40 some odd fixed or new features (about 2000 lines of code), with only 3 runtime errors out the box. granted 3 of 30 hours spent finding the errors sucked, but that's really rare. when i started coding, like everyone, non-trivial bugs were an everyday occurrence. nowadays, it can be months between something like this happening. you know i've only had 3 or 4 lockup or crash to desktop type bugs in 3 years of working on this? i try to keep things simple, try anticipate every possible problem, and try to test thoroughly. in 30 some odd game releases over the years, i'm averaging under 1 bug per release (not including typos and spelling error in text displays).
but you guys are right, if a location struct were simply a member of caveman, animal, and object structs, i could just pass around locations - eliminating the possibility of error while copying data back and forth to and from parameter structs. that's what a location struct is right now, a struct for passing location parameters to functions. beats having to pass mx,mz,x,y,z, and rad separately all the time.