diff --git a/source/core/gamefuncs.h b/source/core/gamefuncs.h index dd3191a79..bc11f3428 100644 --- a/source/core/gamefuncs.h +++ b/source/core/gamefuncs.h @@ -77,16 +77,31 @@ inline DVector2 WallDelta(const walltype* wallnum) return WallEnd(wallnum) - WallStart(wallnum); } +inline double SpriteX(spritetype* spr) +{ + return spr->x * (1 / 16.); +} + inline double SpriteX(int wallnum) { return sprite[wallnum].x * (1 / 16.); } +inline double SpriteY(spritetype* spr) +{ + return spr->y * (1 / -16.); +} + inline double SpriteY(int wallnum) { return sprite[wallnum].y * (1 / -16.); } +inline DVector2 SpritePos(spritetype* spr) +{ + return { SpriteX(spr), SpriteY(spr) }; +} + inline double PointOnLineSide(double x, double y, double linex, double liney, double deltax, double deltay) { return (x - linex) * deltay - (y - liney) * deltax; diff --git a/source/core/maphack.cpp b/source/core/maphack.cpp index e2749c281..70f5a37df 100644 --- a/source/core/maphack.cpp +++ b/source/core/maphack.cpp @@ -146,6 +146,16 @@ static int32_t LoadMapHack(const char *filename) blockingpairs[currentwall].Push(sc.Number); } } + else if (sc.Compare("sector")) + { + if (sc.CheckNumber()) + { + if (currentsprite != -1 && validateSprite()) + { + sprite[currentsprite].sectnum = sc.Number; + } + } + } else if (sc.Compare("picnum")) { if (sc.CheckNumber()) diff --git a/wadsrc/static/engine/compatibility/35ffa2f17ab074263f0963449dc7d463.mhk b/wadsrc/static/engine/compatibility/35ffa2f17ab074263f0963449dc7d463.mhk new file mode 100644 index 000000000..8e7c73da6 --- /dev/null +++ b/wadsrc/static/engine/compatibility/35ffa2f17ab074263f0963449dc7d463.mhk @@ -0,0 +1,2 @@ +// Hickston Swamp E1L3 (RR mod) wall sprite in wrong sector flickers with new renderer +sprite 225 sector 565