Index that reverse_iterator with ints.

If there's even a hint of problems...
Follow the beam's path forward until it hits.
Fix some Singing Sword messages
Fix cursed magical staves and rods blocking weapon skill training.

05c2f7470b missed this because these "weapons" aren't OBJ_WEAPONS.
Don't use __attribute__ ((pure)) directly (xFleury)
Add a way in to minmay_crystal_box
Use runed doors instead of a statue in pandoras_box_mu
Make MSVC happier (xFleury)
Clear the melee and spell masks when polymorphing a monster.

This is so polymorphed monsters don't retain any melee or spell
qualities that their old form had but their new form doesn't (e.g.
dual-wielding).

This should fix Mantis 7043.
Un-redefine some trees

It's buggy (Fedhas is offended by their destruction) and unnecessary.
Don't make unintelligent monsters sometimes avoid grey smoke

They generally tend to not care about walking into danger, so sometimes
thinking that grey smoke (and only grey smoke) is dangerous and then
avoiding it is pretty strange.
Snake tile edits
Remove water moccasin shadows
Fix 'Unlinked item' errors in Abyss.
#7039 Prevent an Abyssal ASSERT after ugprading to 0.12

The brdepth table is unmarshalled from the save file, but a check
for whether to place stairs used a hardcoded depth of 5. I
converted it to check the brdepth table instead, this
prevents downstairs from generating on Abyss:1 for upgraded
saves.

It might be better instead to modify the brdepth table for
Abyss on that upgrade, since unlike other branches that
could have already been generated, the Abyss regenerates
over and over. But I don't want to mess too much with version
compatibility now so I'll leave this for someone who might
understand the implications better than me.
Prevent an ASSERT when getting banished while on Abyss:5

Banishment calls the down_stairs function when in the Abyss.

Unfortunately on Abyss:5 there is nowhere down to go to.

This changes it to cause an Abyssal teleport shift on Abyss:5 instead.
Give debug output after the "new build flags or prefix" message
Handle single-quotes and whitespace in CFLAGS difference check.

This will probably miss changes in the number of consequtive spaces
used in (say) -D flags, but it does put an end to the full rebuilds
we've been having since probably 0.13-a0-692-g87817ed (though these
would presumably also have gone away after the tournament ended).

I'm a bit puzzled about how the whitespace difference came about,
though ...
ORIENT: centre.

This places the vault at the centre of the map, and tries to use a
layout that benefits from having a vault at the centre of the map
(indicated by using the tag "central" in the layout).

A few older vaults have been tagged with ORIENT: centre, and a handful
of layouts have been tagged with central; these are vaults and layouts
that have been observed to benefit from the interaction in the past for
the most part.

This may be the first step towards better specifying how primary vaults
interact with layouts (castle-like maps with layout_stronghold or
layout_gridville, for example, as suggested by mumra).

This also fixes a couple of bugs in the layout selector (in particular,
"no_primary_layout" being ignored outside of Pan).
Move layout_type specs to tags; get primary vault layout_ tags usable.

That is, primary vaults can now properly specify layout types they
should be used with with layout_ tags, and layouts now set the type
through a "layout_type_*" tag as opposed to through a Lua function call.

There were a couple of primary vaults that tried to use these
previously, which was non-functional; this should work now. A handful of
significant primary vaults also now specify layout types to illustrate
this functionality.

This also fixes up a couple of vaults that use layout_ tags to specify
layout names instead of types (which also doesn't work).