mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-19 12:15:31 +02:00
CLOSES #1519
This commit is contained in:
@@ -329,6 +329,10 @@ function OverworldState:setMap(mapId, x, y, facing, opts)
|
||||
MapLoader.invalidateAll()
|
||||
end
|
||||
self.map = MapLoader.load(Game.data, mapId)
|
||||
-- EnterMap -> ClearVariablesOnEnterMap zeroes wStepCounter
|
||||
-- (engine/overworld/clear_variables.asm:7), but a connection crossing
|
||||
-- never reaches EnterMap (home/overworld.asm:675 .loadNewMap)
|
||||
if not (opts and opts.seamless) then Game.save.poisonSteps = 0 end
|
||||
-- STRENGTH deactivates on every real map load (home/overworld.asm
|
||||
-- EnterMap -> ResetUsingStrengthOutOfBattleBit clears BIT_STRENGTH_ACTIVE
|
||||
-- of wStatusFlags1). setMap is the single choke point for every map-id
|
||||
@@ -4296,6 +4300,9 @@ end
|
||||
-- battle is optional; when given, Oak's Lab OPP_RIVAL1 losses skip the
|
||||
-- blackout (pret HandlePlayerBlackOut) so the map script can HealParty.
|
||||
function OverworldState:afterBattle(result, battle)
|
||||
-- .battleOccurred tail-jumps to EnterMap (home/overworld.asm:353), so
|
||||
-- ClearVariablesOnEnterMap zeroes wStepCounter on every battle return
|
||||
Game.save.poisonSteps = 0
|
||||
if battle and battle.kind == "wild" then
|
||||
self.wildEncounterGraceSteps = WILD_ENCOUNTER_GRACE_STEPS
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user