CleverRaven/Cataclysm-DDA — pull request #8951 by BevapDin (2014-09-12 12:11:40+00:00)
Title: Fix vehicle dragging

Fixes #8944 - dragging vehicles inside houses - the problem applies to all vehicles.

This is a side effect of the bashing rework. A vehicle collision previously tested for bashable terrain / furniture. Window frames/open windows/floor/open doors/etc. weren't bashable, so moving there worked fine, but now it's bashable and the vehicles (including dragged ones) collide with them.

Collision of a car (driven by the player or similar) and collision of a dragged vehicle use the same collision check code. So if the car drives over a tile without colliding, the player can drag a vehicle over that tile just fine. If the dragged vehicle collides, so does the driven car.

I added a check for movecost (combined from terrain and furniture) is not 2, assuming that movecost 2 indicates flat terrain. There is also the "FLAT" tag that some terrains have, but this seem to be used for construction purpose.

This has the side effects that some terrains (e.g. floor in houses) is not bashed when *driving* a vehicle across it. This does not affect the actual bashable status, only the collision check.

Just for reference: the bash rework also made window frames (and probably other terrain/furniture) impassable for dragged vehicles, this PR keeps them that way as they have a movecost of 6, and it's actually realistic for window frames.

Maybe there should be a different collision check for dragged vehicle and for driven vehicles?

----

During testing I found a display bug in the map editor: the last line of the terrain list would be hidden by the furniture. Cause is the wrong value used in the modulo calculation: it should check for `(item_count % line_width != 0)`.
I also removed the `num_terrain_types` and `num_furniture_types` - they are only used by editmap and `terlist`/`furnlist` already stores that number.