From 0a3bd7a3a34f42320f54fb7ad7c372e08384cdc7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 17 Aug 2022 22:30:25 +0200 Subject: [PATCH] - walltype::fdelta --- source/core/gamefuncs.h | 4 +--- source/core/maptypes.h | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/source/core/gamefuncs.h b/source/core/gamefuncs.h index 99201b360..e92be6213 100644 --- a/source/core/gamefuncs.h +++ b/source/core/gamefuncs.h @@ -460,9 +460,7 @@ inline int I_GetBuildTime() inline int32_t getangle(walltype* wal) { - return getangle( - wal->point2Wall()->wall_int_pos().X - wal->wall_int_pos().X, - wal->point2Wall()->wall_int_pos().Y - wal->wall_int_pos().Y); + return getangle(wal->fdelta()); } inline TArrayView wallsofsector(const sectortype* sec) diff --git a/source/core/maptypes.h b/source/core/maptypes.h index 432600d88..8bf00a349 100644 --- a/source/core/maptypes.h +++ b/source/core/maptypes.h @@ -428,6 +428,7 @@ struct walltype walltype* lastWall(bool fast = true) const; walltype* point2Wall() const; vec2_t delta() const { return point2Wall()->wall_int_pos() - wall_int_pos(); } + DVector2 fdelta() const { return point2Wall()->pos - pos; } vec2_t center() const { return(point2Wall()->wall_int_pos() + wall_int_pos()) / 2; } DVector2 fcenter() const { return(point2Wall()->pos + pos) / 2; } int deltax() const { return point2Wall()->wall_int_pos().X - wall_int_pos().X; }