Fix vehicle rotation during placement, and refactor mapgen::rotate

Fixes #3918, fixes #3200, and fixes #1801 for real this time.

As I suspected, the vehicle placement code was correctly checking the area where the vehicle *thought* it was going to go, but not where it *actually* ended up, leading to vehicles floating on water, spawning in walls, clipping through each other without becoming wreckage, and so on.

As part of this, I cleaned up mapgen::rotate with:
* Doxygen comment
* Braces on everything
* Less copypasta
* Fewer one-letter variable names