From 08e5fb3f1e86f0ed9ad90ce95ed33fb5e79ac788 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 17 Apr 2026 09:47:51 +0200 Subject: [PATCH] fixed the facing of player characters --- animations.cpp | 2 +- flags.cpp | 4 ++++ graph-monster.cpp | 10 +++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/animations.cpp b/animations.cpp index f161075c..4ef2170d 100644 --- a/animations.cpp +++ b/animations.cpp @@ -104,7 +104,7 @@ EX void animateAttack(const movei& m, int layer) { } EX void animateCorrectAttack(const movei& m, int layer, eMonster who) { - if(among(who, moPlayer, moMimic, moIllusion, moShadow) && (getcs().charid/2) == pshSpaceship) { + if(looks_like_player(who) && (getcs().charid/2) == pshSpaceship) { animate_item_throw(m.s, m.t, itNone, moBullet); return; } diff --git a/flags.cpp b/flags.cpp index 1b4283ae..98ec40ba 100644 --- a/flags.cpp +++ b/flags.cpp @@ -409,4 +409,8 @@ EX bool isDie(eWall w) { return among(w, waRichDie, waHappyDie); } +EX bool looks_like_player(eMonster m) { + return among(m, moPlayer, moMimic, moIllusion, moShadow); + } + } diff --git a/graph-monster.cpp b/graph-monster.cpp index 6f4f27e1..2268cbab 100644 --- a/graph-monster.cpp +++ b/graph-monster.cpp @@ -370,7 +370,15 @@ EX bool drawMonsterType(eMonster m, cell *where, const shiftmatrix& V1, color_t char xch = minf[m].glyph; shiftmatrix V = V1; - if(WDIM == 3 && (classflag(m) & CF_FACE_UP) && where && !mhybrid) V = V1 * cspin90(0, 2); + if(WDIM == 3) { + bool faceup; + if(looks_like_player(m)) + faceup = playershapes[getcs().charid >> 1].is_humanoid; + else + faceup = classflag(m) & CF_FACE_UP; + if(faceup) + V = V1 * cspin90(0, 2); + } #if CAP_SHAPES if(among(m, moTortoise, moWorldTurtle) && where && where->stuntime >= 3)