Japanese Simutrans Forum

日本語simutransフォーラム => バグレポート => トピック開設者: z9999+ さんの発言 2012/05/01 17:31

トピック名: [r5676]calc_severity_colorのオーバーフロー
投稿者: z9999+ さんの発言 2012/05/01 17:31
minimapで電力の需要が供給を超えた場合、高圧線の色が正しくない。

severity_color[MAX_SEVERITY_COLORS] is out of range.
This overflow will be caused in MAP_POWERLINES mode when demand is outstripping supply.



kerte.cc:458
引用
      return reliefkarte_t::severity_color[ clamp( severity, 0, MAX_SEVERITY_COLORS ) ];
↓ should be
引用
      return reliefkarte_t::severity_color[ clamp( severity, 0, MAX_SEVERITY_COLORS-1 ) ];
トピック名: Re:[r5676]calc_severity_colorのオーバーフロー
投稿者: prissi さんの発言 2012/05/04 05:14
Thank, I really did not think correctly, when adding the clamp there ...