Avoid dereference of iterator end.
This commit is contained in:
parent
fa2340413f
commit
807f8d2144
1 changed files with 11 additions and 8 deletions
|
@ -162,16 +162,19 @@ surface getMinimap(int w, int h, const gamemap &map, const team *vw, const std::
|
|||
i = normal_cache->insert(cache_map::value_type(terrain,surf)).first;
|
||||
}
|
||||
|
||||
surf = i->second;
|
||||
if (i != cache->end())
|
||||
{
|
||||
surf = i->second;
|
||||
|
||||
if (need_fogging) {
|
||||
surf = adjust_surface_color(surf,-50,-50,-50);
|
||||
fog_cache->insert(cache_map::value_type(terrain,surf));
|
||||
}
|
||||
if (need_fogging) {
|
||||
surf = adjust_surface_color(surf, -50, -50, -50);
|
||||
fog_cache->insert(cache_map::value_type(terrain, surf));
|
||||
}
|
||||
|
||||
if (need_highlighting) {
|
||||
surf = adjust_surface_color(surf,50,50,50);
|
||||
highlight_cache->insert(cache_map::value_type(terrain,surf));
|
||||
if (need_highlighting) {
|
||||
surf = adjust_surface_color(surf, 50, 50, 50);
|
||||
highlight_cache->insert(cache_map::value_type(terrain, surf));
|
||||
}
|
||||
}
|
||||
|
||||
if(surf != nullptr)
|
||||
|
|
Loading…
Add table
Reference in a new issue