forked from Mirrors/openclonk
Clamp y coordinate when looking up Left/RightColPix, part 2
parent
2b3863a12c
commit
91ff13b81f
|
@ -3696,11 +3696,11 @@ BYTE C4Landscape::GetPix(int32_t x, int32_t y) const // get landscape pixel (bou
|
|||
// Border checks
|
||||
if (x < 0)
|
||||
{
|
||||
return p->LeftColPix[y];
|
||||
return p->LeftColPix[Clamp(y, 0, GetHeight()-1)];
|
||||
}
|
||||
if (static_cast<uint32_t>(x) >= static_cast<uint32_t>(p->Width))
|
||||
{
|
||||
return p->RightColPix[y];
|
||||
return p->RightColPix[Clamp(y, 0, GetHeight()-1)];
|
||||
}
|
||||
if (y < 0)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue