Fix wrong ice beam angle if it goes diagonally up out of map thru world wrap (
bug #718)
deletegear rearrangement applied to branch too. if this causes desyncs you're probably in a crashy state already
couple more use after frees for gear deletion.
also rearranged lines a bit and added a redundant exit to try to proof things a bit.
more evidence we need rust.