Fix wrong permissions on a file.

(cherry picked from commit 824551025ee74b8dad309d438981fb3372b94d3e)
Make vaults_orient_foo tags work properly

They have to be used sparingly since they can prevent
layouts connecting up well, but they work as expected now.
Combine WebTiles messages and send them together

Idea being avoiding lag caused by TCP ACK etc. Crawl process provides
messages like always, but also sends a special flush message to the
WebTiles server that causes them to actually be delivered.
Fix a problem with Webtiles formatted_scroller handling.

The webtiles_write_menu call in formatted_scroller::jump_to could
happen before the menu was sent, which would then result in two menus
on the client side. This was revealed by the message combining
changes, because the two menus would both be in the same message and
the second would be ignored by the client before.
Fix using the help during character creation in Webtiles (#6933).
Don't crash after some view-flashes while travelling.

We often pass the address of an auto-storage targetter to
flash_view_delay (and once directly to flash_view).  If the call to
viewwindow() actually displays the flash, that's fine.  However, if
viewwindow returns early (for example, because the player is travelling
with a delay of -1), the address in you.flash_where could stick around
until the *next* call to viewwindow, at which point the targetter is
out of scope and we get a crash.

To reproduce: set  runrest_ignore_monster += wretched:1  and
travel_delay = -1 , create and alert a wretched star, and travel
(x<movement><enter>) with it in view.  It usually doesn't take long for
the star to pulse with eldritch light and crash the game, at least in
the webtiles build.

Fix this by having flash_view_delay() reset the flash after the delay.
Do the same in cast_{refrigeration,toxic_radiance}, after the more();
ignite_poison already did this, so doesn't need to be fixed.

(cherry picked from commit da99e5649b07fd211f9951b24e469840c7d84ad3)

Conflicts:
	crawl-ref/source/spl-damage.cc
Use ASSERT() rather than assert() in tiles code.

Our version provides more information when it fails, and allows more control.
Fixed Javascript errors introduced in webtiles by 95663a
Reset tile on dungeon_terrain_changed

This fixes a number of issues where a layout/vault applies a tile
to a feature and then subsequent vault/terrain placements incorrectly
inherit that tile.
Also reset feat_idx when resetting the feature tile.

Otherwise, the tile could come back when loading a save.
Default delays to -1 on servers and add a rest_delay

This sets both delays (explore_delay, travel_delay) to -1 for server
play, along with enabling travel trails.

Additionally a rest_delay option is added which also defaults to -1
on servers or 0 locally, to speed up resting.
Fix cursed magical staves and rods blocking weapon skill training.

05c2f7470b missed this because these "weapons" aren't OBJ_WEAPONS.
(cherry picked from commit ff9f909321492e4ac22e043f30b31fb3f3398082)
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.
Don't ID hunger/sust and crash on game load (#7049)

If you were hungry or worse and wearing an unIDed ring of hunger or
ring of sustenance, the initial call to food_change(true) after
reloading the game would identify the ring.  However, the shopping
list is not yet initialized at that point, so the attempt to
update the shopping list to account for the new knowledge causes
a crash.

Fix this by not identifying rings in this situation (even without
the crash it's wrong: saving and restoring shouldn't ID the ring).
(cherry picked from commit 3209c53adf11f002d0472f0249ae69986cd77b59)
Don't allow summoning elementals from monsters or oneself (#7062).

These used to be prevented (with a loop to re-prompt for a new
direction), but it appears that 0.8.0-a0-2376-g29bea47 made that loop no
longer repeat, so these cases started to allow the summon.  Since we now
return a spret_type rather than just a bool, we can abort without spending
a turn, so do that rather than looping.

If the chosen direction contains a monster you cannot see, then we waste
the turn as usual.
(cherry picked from commit 12832719bd0963fde4f72e39c3c74657a3b07eb4)
Confirm self targeting with Dispel Undead
(cherry picked from commit daab79c291b019851678d01b168a31c0896c6bf4)
Fix breakage on big endian.

Not sure if it causes "merely" rebuilding the des cache on every startup, or
the game not working at all -- I don't have a wrong endian machine to test,
and qemu is slower than my phone.  And my phone is from 2009.

(cherry picked from commit 6a4a6370bbc2e26acc501f171d0356159a10c147)
Allow tree form/djinni players to wield vamp weapons.

(cherry picked from commit bb559a8bc6c580c9a57070933052211705b6c0d6)