{"action":"created","issue":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/25893","repository_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA","labels_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/25893/labels{/name}","comments_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/25893/comments","events_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/25893/events","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/25893","id":365107236,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE5MTMyMTkz","number":25893,"title":"Fix falling down mineshaft with experimental z-levels","user":{"login":"alanbrady","id":60370,"node_id":"MDQ6VXNlcjYwMzcw","avatar_url":"https://avatars1.githubusercontent.com/u/60370?v=4","gravatar_id":"","url":"https://api.github.com/users/alanbrady","html_url":"https://github.com/alanbrady","followers_url":"https://api.github.com/users/alanbrady/followers","following_url":"https://api.github.com/users/alanbrady/following{/other_user}","gists_url":"https://api.github.com/users/alanbrady/gists{/gist_id}","starred_url":"https://api.github.com/users/alanbrady/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alanbrady/subscriptions","organizations_url":"https://api.github.com/users/alanbrady/orgs","repos_url":"https://api.github.com/users/alanbrady/repos","events_url":"https://api.github.com/users/alanbrady/events{/privacy}","received_events_url":"https://api.github.com/users/alanbrady/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-29T07:35:00Z","updated_at":"2018-09-29T20:42:09Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/pulls/25893","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/25893","diff_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/25893.diff","patch_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/25893.patch"},"body":"#### Summary\r\nSUMMARY: Bugfixes \"Fix falling down mineshaft with experimental zlevels\"\r\n\r\n#### Purpose of change\r\nDue to the way experimental z-levels check for a valid space to move to when triggering a \"ledge\" trap, things don't work quite right if mapgen doesn't actually generate a valid space to fall to.  This is most evident in underground mines.\r\n\r\nAlso the warning for stepping on a ledge in a mine was broken because of the `m.has_floor_or_support( dest_loc )` check.  We've already established it's a ledge, no need to check if there's not a floor there.\r\n\r\n#### Describe the solution\r\nFix the map::valid_move check to see if we're standing on a ledge tile and return true in that case.\r\n\r\n#### Describe alternatives\r\nThe real root cause is in mapgen not making a valid place to fall in the z-level below in mines, but this could probably be a problem in other cases where mapgen is inconsistent with experimental z-levels.  Just force at least one z-level drop if we're on a ledge.  Once z-levels aren't using ledges for air tiles and mapgen is fixed to be consistent in z-levels, this can be removed.\r\n\r\n#### Additional context\r\nFixes #24070\r\n"},"comment":{"url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/comments/425674203","html_url":"https://github.com/CleverRaven/Cataclysm-DDA/pull/25893#issuecomment-425674203","issue_url":"https://api.github.com/repos/CleverRaven/Cataclysm-DDA/issues/25893","id":425674203,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTY3NDIwMw==","user":{"login":"alanbrady","id":60370,"node_id":"MDQ6VXNlcjYwMzcw","avatar_url":"https://avatars1.githubusercontent.com/u/60370?v=4","gravatar_id":"","url":"https://api.github.com/users/alanbrady","html_url":"https://github.com/alanbrady","followers_url":"https://api.github.com/users/alanbrady/followers","following_url":"https://api.github.com/users/alanbrady/following{/other_user}","gists_url":"https://api.github.com/users/alanbrady/gists{/gist_id}","starred_url":"https://api.github.com/users/alanbrady/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alanbrady/subscriptions","organizations_url":"https://api.github.com/users/alanbrady/orgs","repos_url":"https://api.github.com/users/alanbrady/repos","events_url":"https://api.github.com/users/alanbrady/events{/privacy}","received_events_url":"https://api.github.com/users/alanbrady/received_events","type":"User","site_admin":false},"created_at":"2018-09-29T20:42:09Z","updated_at":"2018-09-29T20:42:09Z","author_association":"CONTRIBUTOR","body":"> Zeds don't always fall down a ledge:\r\nPretty sure this is pre-existing behavior, but it worked out well since I was able to fix both with slightly different fix than initial push.  Let me know if this fixes it."}}
{"actor":{"display_login":"alanbrady"}}