Fixed code assuming map metadata exists, fixed misplaced species data methods, rewrote class PokeBattle_Pokemon

This commit is contained in:
Maruno17
2021-01-20 20:22:31 +00:00
parent 7f254c6434
commit 736bb9ed10
24 changed files with 283 additions and 198 deletions

View File

@@ -392,7 +392,9 @@ end
# Returns the ID number of the region containing the player's current location,
# as determined by the current map's metadata.
def pbGetCurrentRegion(default = -1)
map_pos = ($game_map) ? GameData::MapMetadata.get($game_map.map_id).town_map_position : nil
return default if !$game_map
map_metadata = GameData::MapMetadata.try_get($game_map.map_id)
map_pos = (map_metadata) ? map_metadata.town_map_position : nil
return (map_pos) ? map_pos[0] : default
end