From 702fcec887eebb4966a7f061871cc48adb522b41 Mon Sep 17 00:00:00 2001 From: ALONSO Laurent Date: Thu, 14 Jul 2022 14:34:30 +0200 Subject: [PATCH] boat/horse: try to avoid drawing ghost vehicles... --- src/game/boe.graphutil.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/game/boe.graphutil.cpp b/src/game/boe.graphutil.cpp index 42a75cea..27300506 100644 --- a/src/game/boe.graphutil.cpp +++ b/src/game/boe.graphutil.cpp @@ -319,6 +319,9 @@ void draw_outd_boats(location center) { if(boat.which_town != 200) continue; if(univ.party.in_boat >= 0 && univ.party.boats[univ.party.in_boat] == boat) continue; location loc = local_to_global(boat.loc); + // we must also check that the sector is ok + loc.x += 48 * (boat.sector.x - univ.party.outdoor_corner.x - univ.party.i_w_c.x); + loc.y += 48 * (boat.sector.y - univ.party.outdoor_corner.y - univ.party.i_w_c.y); if(point_onscreen(center, loc) && can_see_light(center, loc, sight_obscurity) < 5) { where_draw.x = loc.x - center.x + 4; where_draw.y = loc.y - center.y + 4; @@ -330,6 +333,9 @@ void draw_outd_boats(location center) { if(horse.which_town != 200) continue; if(univ.party.in_horse >= 0 && univ.party.horses[univ.party.in_horse] == horse) continue; location loc = local_to_global(horse.loc); + // we must also check that the sector is ok + loc.x += 48 * (horse.sector.x - univ.party.outdoor_corner.x - univ.party.i_w_c.x); + loc.y += 48 * (horse.sector.y - univ.party.outdoor_corner.y - univ.party.i_w_c.y); if(point_onscreen(center, loc) && can_see_light(center, loc, sight_obscurity) < 5) { where_draw.x = loc.x - center.x + 4; where_draw.y = loc.y - center.y + 4;