forked from Mirrors/openclonk
Fix crash on ambient map update outside landscape bounds (#1216)
parent
b5560dff25
commit
dffed48b3d
|
@ -3316,6 +3316,8 @@ void C4Landscape::PrepareChange(C4Rect BoundingBox)
|
|||
|
||||
void C4Landscape::FinishChange(C4Rect BoundingBox)
|
||||
{
|
||||
// Intersect bounding box with landscape
|
||||
BoundingBox.Intersect(C4Rect(0, 0, Width, Height));
|
||||
// update render
|
||||
if(pLandscapeRender)
|
||||
pLandscapeRender->Update(BoundingBox, this);
|
||||
|
|
|
@ -126,6 +126,9 @@ void C4FoWAmbient::CreateFromLandscape(const C4Landscape& landscape, double reso
|
|||
|
||||
void C4FoWAmbient::UpdateFromLandscape(const C4Landscape& landscape, const C4Rect& update)
|
||||
{
|
||||
// Nothing to do?
|
||||
if(update.Wdt == 0 || update.Hgt == 0) return;
|
||||
|
||||
assert(Tex != 0);
|
||||
|
||||
// Factor to go from zoomed to landscape coordinates
|
||||
|
|
Loading…
Reference in New Issue