- Dec 24, 2017
- 13
- 5
Towerfag I'm pretty sure there's another problem with the patch system - only one patch that modifies maps can be loaded at once. If there are two, the changes to maps made by the first will be lost. Starting at line 291 of the patch script:
This is run for each patch that is loaded, with $data_maps_patch being reassigned and its old value lost each time. The fix is to iterate through map_data and add all the maps in the currently loading patch to the existing array of maps, like so:
This doesn't affect the rest of the game at all but it'd be a nice touch to have changed, to allow for multiple community patches/fixes at once without needing a monolithic patch that breaks with each update and conflicts with everything else.
Code:
# Maps
$data_mapinfos = map_data[:map_info] if map_data[:map_info]
map_data.delete(:map_info)
$data_maps_patch = map_data
Code:
# Maps
$data_mapinfos = map_data[:map_info] if map_data[:map_info]
map_data.delete(:map_info)
map_data.each { |key, value|
next if value.nil?
$data_maps_patch[key] = value
}