From d0374fd617aa1703e4aa31b8ff3b0f5228636021 Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Tue, 21 Feb 2023 19:25:30 +0300 Subject: [PATCH] gl: fix barrels --- src/game/renders/opengl/r_map.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/game/renders/opengl/r_map.pas b/src/game/renders/opengl/r_map.pas index 992d868..d58daee 100644 --- a/src/game/renders/opengl/r_map.pas +++ b/src/game/renders/opengl/r_map.pas @@ -753,16 +753,20 @@ implementation end; procedure r_Map_DrawMonster (constref mon: TMonster); - var m, a, xx, yy, dx, dy: Integer; d: TDirection; flip: Boolean; t: TGLMultiTexture; + var m, a, xx, yy, dx, dy: Integer; d, da: TDirection; flip: Boolean; t: TGLMultiTexture; begin m := mon.MonsterType; a := mon.MonsterAnim; d := mon.GameDirection; + (* hack: barrel tracks player, fix it in game logic *) + if m = MONSTER_BARREL then d := TDirection.D_LEFT; + r_Common_GetObjectPos(mon.obj, xx, yy); if r_Map_GetMonsterTexture(m, a, d, t, dx, dy, flip) then begin - r_Draw_MultiTextureRepeat(t, mon.DirAnim[a, d], false, xx + dx, yy + dy, t.width, t.height, flip, 255, 255, 255, 255, false); + da := mon.GameDirection; + r_Draw_MultiTextureRepeat(t, mon.DirAnim[a, da], false, xx + dx, yy + dy, t.width, t.height, flip, 255, 255, 255, 255, false); end; if DebugFrames then begin -- 2.29.2