1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 17:24:47 +01:00

Part of #13874: Gymnasiast review

This commit is contained in:
frutiemax
2021-08-27 17:49:32 -04:00
parent 9c53fe252d
commit 5f438535ad
17 changed files with 177 additions and 178 deletions

View File

@@ -881,15 +881,15 @@ static void loc_6A6D7E(
const auto trackType = tileElement->AsTrack()->GetTrackType();
const uint8_t trackSequence = tileElement->AsTrack()->GetSequenceIndex();
const auto& teDescriptor = GetTrackElementDescriptor(trackType);
if (!(teDescriptor.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH))
const auto& ted = GetTrackElementDescriptor(trackType);
if (!(ted.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH))
{
return;
}
uint16_t dx = direction_reverse(
(direction - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK);
if (!(teDescriptor.TrackSequenceProperties[trackSequence] & (1 << dx)))
if (!(ted.TrackSequenceProperties[trackSequence] & (1 << dx)))
{
return;
}
@@ -965,13 +965,13 @@ static void loc_6A6C85(
const auto trackType = tileElementPos.element->AsTrack()->GetTrackType();
const uint8_t trackSequence = tileElementPos.element->AsTrack()->GetSequenceIndex();
const auto& teDescriptor = GetTrackElementDescriptor(trackType);
if (!(teDescriptor.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH))
const auto& ted = GetTrackElementDescriptor(trackType);
if (!(ted.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH))
{
return;
}
uint16_t dx = (direction - tileElementPos.element->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK;
if (!(teDescriptor.TrackSequenceProperties[trackSequence] & (1 << dx)))
if (!(ted.TrackSequenceProperties[trackSequence] & (1 << dx)))
{
return;
}
@@ -2107,11 +2107,11 @@ bool tile_element_wants_path_connection_towards(const TileCoordsXYZD& coords, co
const auto trackType = tileElement->AsTrack()->GetTrackType();
const uint8_t trackSequence = tileElement->AsTrack()->GetSequenceIndex();
const auto& teDescriptor = GetTrackElementDescriptor(trackType);
if (teDescriptor.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH)
const auto& ted = GetTrackElementDescriptor(trackType);
if (ted.TrackSequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH)
{
uint16_t dx = ((coords.direction - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK);
if (teDescriptor.TrackSequenceProperties[trackSequence] & (1 << dx))
if (ted.TrackSequenceProperties[trackSequence] & (1 << dx))
{
// Track element has the flags required for the given direction
return true;