1
0
Fork 0

Fix #14433: Broken road stop drawing due to incorrect modes conversion. (#14434)

The mask was treated as a single RoadStopDrawMode instead of a RoadStopDrawModes bitset.
pull/14435/head
Peter Nelson 2025-07-14 17:25:53 +01:00 committed by GitHub
parent fc924161ab
commit b2de1ff66f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -105,8 +105,8 @@ static ChangeInfoResult RoadStopChangeInfo(uint first, uint last, int prop, Byte
AddStringForMapping(GRFStringID{buf.ReadWord()}, [rs = rs.get()](StringID str) { RoadStopClass::Get(rs->class_index)->name = str; }); AddStringForMapping(GRFStringID{buf.ReadWord()}, [rs = rs.get()](StringID str) { RoadStopClass::Get(rs->class_index)->name = str; });
break; break;
case 0x0C: // The draw mode case 0x0C: // The draw modes
rs->draw_mode = static_cast<RoadStopDrawMode>(buf.ReadByte()); rs->draw_mode = static_cast<RoadStopDrawModes>(buf.ReadByte());
break; break;
case 0x0D: // Cargo types for random triggers case 0x0D: // Cargo types for random triggers

View File

@ -298,7 +298,7 @@ void DrawRoadStopTile(int x, int y, RoadType roadtype, const RoadStopSpec *spec,
RoadStopDrawModes draw_mode; RoadStopDrawModes draw_mode;
if (spec->flags.Test(RoadStopSpecFlag::DrawModeRegister)) { if (spec->flags.Test(RoadStopSpecFlag::DrawModeRegister)) {
draw_mode = static_cast<RoadStopDrawMode>(object.GetRegister(0x100)); draw_mode = static_cast<RoadStopDrawModes>(object.GetRegister(0x100));
} else { } else {
draw_mode = spec->draw_mode; draw_mode = spec->draw_mode;
} }

View File

@ -3331,7 +3331,7 @@ draw_default_foundation:
auto result = GetRoadStopLayout(ti, stopspec, st, type, view, regs100); auto result = GetRoadStopLayout(ti, stopspec, st, type, view, regs100);
if (result.has_value()) { if (result.has_value()) {
if (stopspec->flags.Test(RoadStopSpecFlag::DrawModeRegister)) { if (stopspec->flags.Test(RoadStopSpecFlag::DrawModeRegister)) {
stop_draw_mode = static_cast<RoadStopDrawMode>(regs100[0]); stop_draw_mode = static_cast<RoadStopDrawModes>(regs100[0]);
} }
if (type == StationType::RoadWaypoint && stop_draw_mode.Test(RoadStopDrawMode::WaypGround)) { if (type == StationType::RoadWaypoint && stop_draw_mode.Test(RoadStopDrawMode::WaypGround)) {
draw_ground = true; draw_ground = true;