EDIT: Unsurprisingly, I managed to fix this (once again) right after I posted a support topic. >:E
Very well, I guess you can just review/critique this scriptlet.
I'm working on modifying the default "Game_Map" script under terrain tags. Currently the program does not recognize events with tileset graphics as having terrain tags, and I'd like to correct this.
Here's the default code:
Here's my attempt at fixing this:
Very well, I guess you can just review/critique this scriptlet.
I'm working on modifying the default "Game_Map" script under terrain tags. Currently the program does not recognize events with tileset graphics as having terrain tags, and I'd like to correct this.
Here's the default code:
Code:
class Game_Map
def terrain_tag(x, y)
if @map_id != 0
for i in [2, 1, 0]
tile_id = data[x, y, i]
if tile_id == nil
return 0
elsif @terrain_tags[tile_id] > 0
return @terrain_tags[tile_id]
end
end
end
return 0
end
end
Here's my attempt at fixing this:
Code:
class Game_Map
def terrain_tag(x, y)
if @map_id != 0
for i in [2, 1, 0]
tile_id = data[x, y, i]
if tile_id == nil
return 0
elsif @terrain_tags[tile_id] > 0
for event in $game_map.events.values
if event.x == x and event.y == y and event.through == false and event.tile_id != nil and @terrain_tags[event.tile_id] > 0
return @terrain_tags[event.tile_id]
end
end
return @terrain_tags[tile_id]
end
end
end
return 0
end
end