From f275790aec4a796ed969b099364abfdf25385967 Mon Sep 17 00:00:00 2001 From: Rangi Date: Thu, 2 Jul 2020 23:30:21 -0400 Subject: Add subdirectories to engine/ similar to pokecrystal --- engine/events/set_blackout_map.asm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 engine/events/set_blackout_map.asm (limited to 'engine/events/set_blackout_map.asm') diff --git a/engine/events/set_blackout_map.asm b/engine/events/set_blackout_map.asm new file mode 100644 index 00000000..14f0ba28 --- /dev/null +++ b/engine/events/set_blackout_map.asm @@ -0,0 +1,25 @@ +SetLastBlackoutMap: +; Set the map to return to when +; blacking out or using Teleport or Dig. +; Safari rest houses don't count. + + push hl + ld hl, SafariZoneRestHouses + ld a, [wCurMap] + ld b, a +.loop + ld a, [hli] + cp -1 + jr z, .notresthouse + cp b + jr nz, .loop + jr .done + +.notresthouse + ld a, [wLastMap] + ld [wLastBlackoutMap], a +.done + pop hl + ret + +INCLUDE "data/rest_house_maps.asm" -- cgit v1.3.1-sl0p