Add some range checking based on testing in Fusil.
Authored by: mdboom 2008-07-10
Parent: [r5732]
Child: [r5734]