diff --git a/source/build/include/buildtypes.h b/source/build/include/buildtypes.h index caf5eda00..1ac86d561 100644 --- a/source/build/include/buildtypes.h +++ b/source/build/include/buildtypes.h @@ -94,6 +94,8 @@ struct walltype int xpan() const { return int(xpan_); } int ypan() const { return int(ypan_); } + void setxpan(float add) { xpan_ = fmod(add + 512, 256); } // +512 is for handling negative offsets + void setypan(float add) { ypan_ = fmod(add + 512, 256); } // +512 is for handling negative offsets void addxpan(float add) { xpan_ = fmod(xpan_ + add + 512, 256); } // +512 is for handling negative offsets void addypan(float add) { ypan_ = fmod(ypan_ + add + 512, 256); } // +512 is for handling negative offsets diff --git a/source/games/exhumed/src/lighting.cpp b/source/games/exhumed/src/lighting.cpp index ba2d39202..3b8b62a8c 100644 --- a/source/games/exhumed/src/lighting.cpp +++ b/source/games/exhumed/src/lighting.cpp @@ -745,8 +745,8 @@ void DoFlows() { short nWall = sFlowInfo[i].objindex; - wall[nWall].addxpan(sFlowInfo[i].xdelta / 16384.f); - wall[nWall].addypan(sFlowInfo[i].ydelta / 16384.f); + wall[nWall].setxpan(sFlowInfo[i].xdelta / 16384.f); + wall[nWall].setypan(sFlowInfo[i].ydelta / 16384.f); if (sFlowInfo[i].xdelta < 0) { @@ -765,8 +765,8 @@ void DoFlows() { short nWall = sFlowInfo[i].objindex; - wall[nWall].addxpan(sFlowInfo[i].xdelta / 16384.f); - wall[nWall].addypan(sFlowInfo[i].ydelta / 16384.f); + wall[nWall].setxpan(sFlowInfo[i].xdelta / 16384.f); + wall[nWall].setypan(sFlowInfo[i].ydelta / 16384.f); if (sFlowInfo[i].xdelta >= sFlowInfo[i].xacc) {