Skip to content

Commit

Permalink
correct bounds check
Browse files Browse the repository at this point in the history
  • Loading branch information
lostsquirrel1 committed Aug 1, 2024
1 parent 0889e95 commit 9235fab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rts/Sim/Misc/YardmapStatusEffectsMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class YardmapStatusEffectsMap {

uint32_t interleave(uint32_t x, uint32_t z)
{
x = std::clamp(int(x), 0, mapDims.mapx);
z = std::clamp(int(z), 0, mapDims.mapy);
x = std::clamp(int(x), 0, mapDims.mapxm1);
z = std::clamp(int(z), 0, mapDims.mapym1);

static constexpr uint32_t zMasks[] = {0x0000FFFF, 0x00FF00FF, 0x0F0F0F0F, 0x33333333, 0x55555555};
static constexpr uint32_t zShifts[] = {16, 8, 4, 2, 1};
Expand Down

0 comments on commit 9235fab

Please sign in to comment.