From 6e2b6f86b7aef8aea66a43e6c4f8dd4d46cd6921 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 14 May 2025 11:52:15 -0500 Subject: [PATCH] Fix big monsters not drawing partially at top or left --- src/game/boe.graphutil.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/game/boe.graphutil.cpp b/src/game/boe.graphutil.cpp index db500c2d..322af44c 100644 --- a/src/game/boe.graphutil.cpp +++ b/src/game/boe.graphutil.cpp @@ -156,11 +156,20 @@ void draw_monsters() { if(is_town() || is_combat()) { for(short i = 0; i < univ.town.monst.size(); i++) { const cCreature& monst = univ.town.monst[i]; - if(monst.is_alive() && !monst.invisible && monst.status[eStatus::INVISIBLE] <= 0) - if(point_onscreen(center,monst.cur_loc) && party_can_see_monst(i)) { + if(monst.is_alive() && !monst.invisible && monst.status[eStatus::INVISIBLE] <= 0){ + std::tie(width, height) = get_monst_dims(monst.number); + bool on_screen = false; + for(int x = monst.cur_loc.x; x < monst.cur_loc.x + width; ++x){ + for(int y = monst.cur_loc.y; y < monst.cur_loc.y + height; ++y){ + if(point_onscreen(center, {x, y})){ + on_screen = true; + break; + } + } + } + if(on_screen && party_can_see_monst(i)) { where_draw.x = monst.cur_loc.x - center.x + 4; where_draw.y = monst.cur_loc.y - center.y + 4; - std::tie(width, height) = get_monst_dims(monst.number); for(short k = 0; k < width * height; k++) { store_loc = where_draw; @@ -192,6 +201,7 @@ void draw_monsters() { } } } + } } } }