Q3:
if tilesets.priorities[new_orders[k-1]] > tilesets.priorities[temp]
小概率出现 '>': comparison of Fixnum with nil failed (ArgumentError) 问题。。。
自解决:
前部分插入
break if tilesets.priorities[new_orders[k-1]].nil?
break if tilesets.priorities[temp].nil?
不过效果不理想 可能会 ”备份脚本“
期待LZ尝试优化。。。
其他自行优化部分:
PS1:
导出全部地图时可以尝试加入
45.插入
fileName=sprintf("#{DIR_OUT}Map%03d.png", id)
if File.exists?(fileName)
next if File.size(fileName)>100
end
51.替换
bitmap.save_as_png(fileName)
避免中途出错后重复导出