forked from rosebudai/OpenRCT2-Web
Remove redundant parenthesis around negated .has FlagHolder checks
This commit is contained in:
1 parent
7f5806aa31
commit
39729f23e9
39 files changed
+92
-92
No files matched your search
@@ -862,7 +862,7 @@ public:
|
||||
{
|
||||
if (w->flags.has(WindowFlag::dead))
|
||||
continue;
|
||||
if (!(w->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront, WindowFlag::noAutoClose)))
|
||||
if (!w->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront, WindowFlag::noAutoClose))
|
||||
{
|
||||
Close(*w.get());
|
||||
break;
|
||||
@@ -884,7 +884,7 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!(flags.has(WindowFlag::stickToFront)))
|
||||
else if (!flags.has(WindowFlag::stickToFront))
|
||||
{
|
||||
for (auto it = gWindowList.rbegin(); it != gWindowList.rend(); it++)
|
||||
{
|
||||
@@ -903,7 +903,7 @@ public:
|
||||
wp->flags = flags;
|
||||
|
||||
// Play sounds and flash the window
|
||||
if (!(flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront)))
|
||||
if (!flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront))
|
||||
{
|
||||
wp->flash();
|
||||
OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::windowOpen, 0, pos.x + (windowSize.width / 2));
|
||||
@@ -964,7 +964,7 @@ public:
|
||||
{
|
||||
if (w->flags.has(WindowFlag::dead))
|
||||
continue;
|
||||
if (!(w->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront, WindowFlag::noAutoClose)))
|
||||
if (!w->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront, WindowFlag::noAutoClose))
|
||||
{
|
||||
foundW = w.get();
|
||||
break;
|
||||
@@ -1007,7 +1007,7 @@ public:
|
||||
// Now close the collected windows
|
||||
for (auto* wnd : windowsToClose)
|
||||
{
|
||||
if (!(wnd->flags.has(WindowFlag::dead)))
|
||||
if (!wnd->flags.has(WindowFlag::dead))
|
||||
{
|
||||
Close(*wnd);
|
||||
}
|
||||
@@ -1053,7 +1053,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
auto pred = [](WindowBase* w) -> bool { return !(w->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront)); };
|
||||
auto pred = [](WindowBase* w) -> bool { return !w->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront); };
|
||||
CloseByCondition(pred, WindowCloseFlags::CloseSingle);
|
||||
}
|
||||
|
||||
@@ -1066,14 +1066,14 @@ public:
|
||||
{
|
||||
CloseByClass(WindowClass::dropdown);
|
||||
CloseByCondition(
|
||||
[](WindowBase* w) -> bool { return !(w->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront)); });
|
||||
[](WindowBase* w) -> bool { return !w->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront); });
|
||||
}
|
||||
|
||||
void CloseAllExceptClass(WindowClass cls) override
|
||||
{
|
||||
CloseByClass(WindowClass::dropdown);
|
||||
CloseByCondition([cls](WindowBase* w) -> bool {
|
||||
return w->classification != cls && !(w->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront));
|
||||
return w->classification != cls && !w->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1082,7 +1082,7 @@ public:
|
||||
*/
|
||||
void CloseAllExceptFlags(WindowFlags flags) override
|
||||
{
|
||||
CloseByCondition([flags](WindowBase* w) -> bool { return !(w->flags.hasAny(flags)); });
|
||||
CloseByCondition([flags](WindowBase* w) -> bool { return !w->flags.hasAny(flags); });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1094,7 +1094,7 @@ public:
|
||||
CloseByCondition([cls, number](WindowBase* w) -> bool {
|
||||
return (
|
||||
!(w->number == number && w->classification == cls)
|
||||
&& !(w->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront)));
|
||||
&& !w->flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1327,7 +1327,7 @@ public:
|
||||
*/
|
||||
WindowBase* BringToFront(WindowBase& w) override
|
||||
{
|
||||
if (!(w.flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront)))
|
||||
if (!w.flags.hasAny(WindowFlag::stickToBack, WindowFlag::stickToFront))
|
||||
{
|
||||
auto itSourcePos = WindowGetIterator(&w);
|
||||
if (itSourcePos != gWindowList.end())
|
||||
@@ -1341,7 +1341,7 @@ public:
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (!(w2->flags.has(WindowFlag::stickToFront)))
|
||||
if (!w2->flags.has(WindowFlag::stickToFront))
|
||||
{
|
||||
// base() returns the next element in the list, so we need to decrement it.
|
||||
itDestPos = std::prev(it.base());
|
||||
|
||||
@@ -397,7 +397,7 @@ namespace OpenRCT2
|
||||
break;
|
||||
|
||||
if (w->classification != _dragWidget.windowClassification || w->number != _dragWidget.windowNumber
|
||||
|| !(gInputFlags.has(InputFlag::toolActive)))
|
||||
|| !gInputFlags.has(InputFlag::toolActive))
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -591,7 +591,7 @@ namespace OpenRCT2
|
||||
}
|
||||
else if (differentialCoords.x != 0 || differentialCoords.y != 0)
|
||||
{
|
||||
if (!(w->flags.has(WindowFlag::noScrolling)))
|
||||
if (!w->flags.has(WindowFlag::noScrolling))
|
||||
{
|
||||
// User dragged a scrollable viewport
|
||||
|
||||
|
||||
@@ -1024,7 +1024,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
*/
|
||||
void WindowDrawWidgets(WindowBase& w, RenderTarget& rt)
|
||||
{
|
||||
if ((w.flags.has(WindowFlag::transparent)) && !(w.flags.has(WindowFlag::noBackground)))
|
||||
if ((w.flags.has(WindowFlag::transparent)) && !w.flags.has(WindowFlag::noBackground))
|
||||
Rectangle::filter(
|
||||
rt, { w.windowPos, w.windowPos + ScreenCoordsXY{ w.width - 1, w.height - 1 } }, FilterPaletteID::palette51);
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
return state_changed;
|
||||
}
|
||||
|
||||
if (!(gMapSelectFlags.has(MapSelectFlag::enable)))
|
||||
if (!gMapSelectFlags.has(MapSelectFlag::enable))
|
||||
{
|
||||
gMapSelectFlags.set(MapSelectFlag::enable);
|
||||
state_changed++;
|
||||
|
||||
@@ -643,7 +643,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
}
|
||||
|
||||
// Update provisional bridge mode path
|
||||
if (!(_provisionalFootpath.flags.has(ProvisionalPathFlag::placed)))
|
||||
if (!_provisionalFootpath.flags.has(ProvisionalPathFlag::placed))
|
||||
{
|
||||
ObjectEntryIndex type;
|
||||
ObjectEntryIndex railings = gFootpathSelection.Railings;
|
||||
|
||||
@@ -461,7 +461,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
return state_changed;
|
||||
}
|
||||
|
||||
if (!(gMapSelectFlags.has(MapSelectFlag::enable)))
|
||||
if (!gMapSelectFlags.has(MapSelectFlag::enable))
|
||||
{
|
||||
gMapSelectFlags.set(MapSelectFlag::enable);
|
||||
state_changed++;
|
||||
@@ -616,7 +616,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
if (gCurrentToolId == Tool::upDownArrow)
|
||||
{
|
||||
if (!(gMapSelectFlags.has(MapSelectFlag::enable)))
|
||||
if (!gMapSelectFlags.has(MapSelectFlag::enable))
|
||||
return;
|
||||
|
||||
money64 lower_cost = SelectionLowerLand(SelectionMode::query);
|
||||
@@ -660,7 +660,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
uint8_t state_changed = 0;
|
||||
|
||||
if (!(gMapSelectFlags.has(MapSelectFlag::enable)))
|
||||
if (!gMapSelectFlags.has(MapSelectFlag::enable))
|
||||
{
|
||||
gMapSelectFlags.set(MapSelectFlag::enable);
|
||||
state_changed++;
|
||||
@@ -737,7 +737,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
uint8_t state_changed = 0;
|
||||
|
||||
if (!(gMapSelectFlags.has(MapSelectFlag::enable)))
|
||||
if (!gMapSelectFlags.has(MapSelectFlag::enable))
|
||||
{
|
||||
gMapSelectFlags.set(MapSelectFlag::enable);
|
||||
state_changed++;
|
||||
|
||||
@@ -477,7 +477,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
uint8_t state_changed = 0;
|
||||
|
||||
if (!(gMapSelectFlags.has(MapSelectFlag::enable)))
|
||||
if (!gMapSelectFlags.has(MapSelectFlag::enable))
|
||||
{
|
||||
gMapSelectFlags.set(MapSelectFlag::enable);
|
||||
state_changed++;
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
return;
|
||||
|
||||
auto stateChanged = false;
|
||||
if (!(gMapSelectFlags.has(MapSelectFlag::enable)))
|
||||
if (!gMapSelectFlags.has(MapSelectFlag::enable))
|
||||
stateChanged = true;
|
||||
|
||||
if (gMapSelectType != MapSelectType::full)
|
||||
|
||||
@@ -1138,12 +1138,12 @@ namespace OpenRCT2::Ui::Windows
|
||||
break;
|
||||
case WIDX_NEXT_SECTION:
|
||||
RideSelectNextSection();
|
||||
if (!(gMapSelectFlags.has(MapSelectFlag::enable)))
|
||||
if (!gMapSelectFlags.has(MapSelectFlag::enable))
|
||||
VirtualFloorSetHeight(_currentTrackBegin.z);
|
||||
break;
|
||||
case WIDX_PREVIOUS_SECTION:
|
||||
RideSelectPreviousSection();
|
||||
if (!(gMapSelectFlags.has(MapSelectFlag::enable)))
|
||||
if (!gMapSelectFlags.has(MapSelectFlag::enable))
|
||||
VirtualFloorSetHeight(_currentTrackBegin.z);
|
||||
break;
|
||||
case WIDX_LEFT_CURVE:
|
||||
@@ -3268,7 +3268,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
arrowDirection = DirectionReverse(arrowDirection);
|
||||
gMapSelectArrowDirection = arrowDirection;
|
||||
|
||||
if (!(gMapSelectFlags.has(MapSelectFlag::enable)))
|
||||
if (!gMapSelectFlags.has(MapSelectFlag::enable))
|
||||
{
|
||||
// Set height to where the next track piece would begin
|
||||
VirtualFloorSetHeight(_currentTrackBegin.z);
|
||||
@@ -4806,7 +4806,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
if (_currentTrackPitchEnd != TrackPitch::None)
|
||||
ViewportSetVisibility(ViewportVisibility::trackHeights);
|
||||
|
||||
if (!(gMapSelectFlags.has(MapSelectFlag::enable)))
|
||||
if (!gMapSelectFlags.has(MapSelectFlag::enable))
|
||||
{
|
||||
// Set height to where the next track piece would begin
|
||||
VirtualFloorSetHeight(trackPos.z - zBegin + zEnd);
|
||||
|
||||
@@ -299,7 +299,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
if (gCurrentToolId == Tool::upDownArrow)
|
||||
{
|
||||
if (!(gMapSelectFlags.has(MapSelectFlag::enable)))
|
||||
if (!gMapSelectFlags.has(MapSelectFlag::enable))
|
||||
return;
|
||||
|
||||
auto waterLowerAction = GameActions::WaterLowerAction(
|
||||
@@ -342,7 +342,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
|
||||
uint8_t state_changed = 0;
|
||||
|
||||
if (!(gMapSelectFlags.has(MapSelectFlag::enable)))
|
||||
if (!gMapSelectFlags.has(MapSelectFlag::enable))
|
||||
{
|
||||
gMapSelectFlags.set(MapSelectFlag::enable);
|
||||
state_changed++;
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace OpenRCT2::GameActions
|
||||
if (!(pathElement->GetEdges() & (1 << _loc.direction)))
|
||||
continue;
|
||||
|
||||
if (pathElement->IsGhost() && !(GetFlags().has(CommandFlag::ghost)))
|
||||
if (pathElement->IsGhost() && !GetFlags().has(CommandFlag::ghost))
|
||||
continue;
|
||||
|
||||
return pathElement;
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
if (bannerElement->GetBaseZ() != _loc.z)
|
||||
continue;
|
||||
if (bannerElement->IsGhost() && !(GetFlags().has(CommandFlag::ghost)))
|
||||
if (bannerElement->IsGhost() && !GetFlags().has(CommandFlag::ghost))
|
||||
continue;
|
||||
if (bannerElement->GetPosition() != _loc.direction)
|
||||
continue;
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
|
||||
// No change
|
||||
if (!(GetFlags().has(CommandFlag::ghost)) && pathElement->GetAdditionEntryIndex() == _entryIndex
|
||||
if (!GetFlags().has(CommandFlag::ghost) && pathElement->GetAdditionEntryIndex() == _entryIndex
|
||||
&& !(pathElement->IsBroken()))
|
||||
{
|
||||
return res;
|
||||
@@ -156,7 +156,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
|
||||
// No change
|
||||
if (!(GetFlags().has(CommandFlag::ghost)) && pathElement->GetAdditionEntryIndex() == _entryIndex
|
||||
if (!GetFlags().has(CommandFlag::ghost) && pathElement->GetAdditionEntryIndex() == _entryIndex
|
||||
&& !(pathElement->IsBroken()) && !pathElement->AdditionIsGhost())
|
||||
{
|
||||
return res;
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace OpenRCT2::GameActions
|
||||
Result FootpathAdditionRemoveAction::Execute(GameState_t& gameState) const
|
||||
{
|
||||
auto* pathElement = MapGetFootpathElement(_loc);
|
||||
if (!(GetFlags().has(CommandFlag::ghost)))
|
||||
if (!GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
FootpathInterruptPeeps(_loc);
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace OpenRCT2::GameActions
|
||||
res.expenditure = ExpenditureType::landscaping;
|
||||
res.position = _loc.ToTileCentre();
|
||||
|
||||
if (!(GetFlags().has(CommandFlag::ghost)))
|
||||
if (!GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
FootpathInterruptPeeps(_loc);
|
||||
}
|
||||
@@ -191,7 +191,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
bool entrancePath = false, entranceIsSamePath = false;
|
||||
|
||||
if (!(GetFlags().hasAny(CommandFlag::allowDuringPaused, CommandFlag::ghost)))
|
||||
if (!GetFlags().hasAny(CommandFlag::allowDuringPaused, CommandFlag::ghost))
|
||||
{
|
||||
FootpathRemoveLitter(_loc);
|
||||
}
|
||||
@@ -247,7 +247,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (entrancePath)
|
||||
{
|
||||
if (!(GetFlags().has(CommandFlag::ghost)) && !entranceIsSamePath)
|
||||
if (!GetFlags().has(CommandFlag::ghost) && !entranceIsSamePath)
|
||||
{
|
||||
if (_constructFlags & PathConstructFlag::IsLegacyPathObject)
|
||||
{
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace OpenRCT2::GameActions
|
||||
res.expenditure = ExpenditureType::landscaping;
|
||||
res.position = _loc.ToTileCentre();
|
||||
|
||||
if (!(GetFlags().has(CommandFlag::ghost)))
|
||||
if (!GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
FootpathInterruptPeeps(_loc);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ namespace OpenRCT2::GameActions
|
||||
// Force ride construction to recheck area
|
||||
_currentTrackSelectionFlags.set(TrackSelectionFlag::recheck);
|
||||
|
||||
if (!(GetFlags().has(CommandFlag::ghost)))
|
||||
if (!GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
if (_direction != kInvalidDirection && !getGameState().cheats.disableClearanceChecks)
|
||||
{
|
||||
@@ -239,7 +239,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
FootpathQueueChainReset();
|
||||
|
||||
if (!(GetFlags().has(CommandFlag::trackDesign)))
|
||||
if (!GetFlags().has(CommandFlag::trackDesign))
|
||||
{
|
||||
FootpathRemoveEdgesAt(_loc, reinterpret_cast<TileElement*>(pathElement));
|
||||
}
|
||||
@@ -355,7 +355,7 @@ namespace OpenRCT2::GameActions
|
||||
{
|
||||
bool entrancePath = false, entranceIsSamePath = false;
|
||||
|
||||
if (!(GetFlags().hasAny(CommandFlag::allowDuringPaused, CommandFlag::ghost)))
|
||||
if (!GetFlags().hasAny(CommandFlag::allowDuringPaused, CommandFlag::ghost))
|
||||
{
|
||||
FootpathRemoveLitter(_loc);
|
||||
}
|
||||
@@ -410,7 +410,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (entrancePath)
|
||||
{
|
||||
if (!(GetFlags().has(CommandFlag::ghost)) && !entranceIsSamePath)
|
||||
if (!GetFlags().has(CommandFlag::ghost) && !entranceIsSamePath)
|
||||
{
|
||||
if (_constructFlags & PathConstructFlag::IsLegacyPathObject)
|
||||
{
|
||||
@@ -449,11 +449,11 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
FootpathQueueChainReset();
|
||||
|
||||
if (!(GetFlags().has(CommandFlag::trackDesign)))
|
||||
if (!GetFlags().has(CommandFlag::trackDesign))
|
||||
{
|
||||
FootpathRemoveEdgesAt(_loc, pathElement->as<TileElement>());
|
||||
}
|
||||
if (gLegacyScene == LegacyScene::scenarioEditor && !(GetFlags().has(CommandFlag::ghost)))
|
||||
if (gLegacyScene == LegacyScene::scenarioEditor && !GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
AutomaticallySetPeepSpawn();
|
||||
}
|
||||
@@ -505,7 +505,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
void FootpathPlaceAction::RemoveIntersectingWalls(PathElement* pathElement) const
|
||||
{
|
||||
if (pathElement->IsSloped() && !(GetFlags().has(CommandFlag::ghost)))
|
||||
if (pathElement->IsSloped() && !GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
auto direction = pathElement->GetSlopeDirection();
|
||||
int32_t z = pathElement->GetBaseZ();
|
||||
@@ -520,7 +520,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
}
|
||||
|
||||
if (!(GetFlags().has(CommandFlag::trackDesign)))
|
||||
if (!GetFlags().has(CommandFlag::trackDesign))
|
||||
FootpathConnectEdges(_loc, reinterpret_cast<TileElement*>(pathElement), GetFlags());
|
||||
|
||||
FootpathUpdateQueueChains();
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace OpenRCT2::GameActions
|
||||
res.expenditure = ExpenditureType::landscaping;
|
||||
res.position = { _loc.x + 16, _loc.y + 16, _loc.z };
|
||||
|
||||
if (!(GetFlags().has(CommandFlag::ghost)))
|
||||
if (!GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
FootpathInterruptPeeps(_loc);
|
||||
FootpathRemoveLitter(_loc);
|
||||
|
||||
@@ -405,7 +405,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
else
|
||||
{
|
||||
bool commandExecutes = !(flags.hasAny(CommandFlag::ghost, CommandFlag::noSpend));
|
||||
bool commandExecutes = !flags.hasAny(CommandFlag::ghost, CommandFlag::noSpend);
|
||||
|
||||
bool recordAction = false;
|
||||
if (replayManager != nullptr && !ignoreForReplays)
|
||||
@@ -437,7 +437,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
|
||||
// Only show errors when its not a ghost and not a preview and also top level action.
|
||||
bool shouldShowError = !(flags.has(CommandFlag::ghost)) && !(flags.has(CommandFlag::noSpend)) && topLevel;
|
||||
bool shouldShowError = !flags.has(CommandFlag::ghost) && !flags.has(CommandFlag::noSpend) && topLevel;
|
||||
|
||||
// In network mode the error should be only shown to the issuer of the action.
|
||||
if (Network::GetMode() != Network::Mode::none)
|
||||
|
||||
@@ -287,7 +287,7 @@ namespace OpenRCT2::GameActions
|
||||
const auto clearanceData = canBuild.getData<ConstructClearResult>();
|
||||
resultData.GroundFlags = clearanceData.GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND);
|
||||
|
||||
if (!(GetFlags().has(CommandFlag::ghost)))
|
||||
if (!GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
FootpathRemoveLitter({ curTile, zLow });
|
||||
if (!getGameState().cheats.disableClearanceChecks)
|
||||
|
||||
@@ -162,7 +162,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
|
||||
auto flags = GetFlags();
|
||||
if (!(flags.has(CommandFlag::ghost)))
|
||||
if (!flags.has(CommandFlag::ghost))
|
||||
{
|
||||
FootpathRemoveLitter(_loc);
|
||||
WallRemoveAt({ _loc.ToTileStart(), _loc.z, _loc.z + 32 });
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
|
||||
auto flags = GetFlags();
|
||||
if (!(flags.has(CommandFlag::ghost)))
|
||||
if (!flags.has(CommandFlag::ghost))
|
||||
{
|
||||
FootpathRemoveLitter(_loc);
|
||||
WallRemoveAt({ _loc.ToTileStart(), _loc.z, _loc.z + 32 });
|
||||
@@ -237,7 +237,7 @@ namespace OpenRCT2::GameActions
|
||||
ride->getStation().SetBaseZ(tileElement->GetBaseZ());
|
||||
ride->getStation().Start = { 0, 0 };
|
||||
|
||||
if (_initialPlacement && !(flags.has(CommandFlag::ghost)))
|
||||
if (_initialPlacement && !flags.has(CommandFlag::ghost))
|
||||
{
|
||||
ride->overallView = startLoc;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace OpenRCT2::GameActions
|
||||
entranceLoc.y += CoordsDirectionDelta[(_loc.direction + 1) & 0x3].y * 2;
|
||||
}
|
||||
|
||||
if (!(flags.has(CommandFlag::ghost)))
|
||||
if (!flags.has(CommandFlag::ghost))
|
||||
{
|
||||
SurfaceElement* surfaceElement = MapGetSurfaceElementAt(entranceLoc);
|
||||
if (surfaceElement != nullptr)
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace OpenRCT2::GameActions
|
||||
return Result(Status::invalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND);
|
||||
}
|
||||
|
||||
if (!(GetFlags().has(CommandFlag::ghost)))
|
||||
if (!GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
RideClearForConstruction(*ride);
|
||||
ride->removePeeps();
|
||||
@@ -177,7 +177,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
|
||||
auto z = station.GetBaseZ();
|
||||
if (!(GetFlags().has(CommandFlag::allowDuringPaused)) && !(GetFlags().has(CommandFlag::ghost))
|
||||
if (!GetFlags().has(CommandFlag::allowDuringPaused) && !GetFlags().has(CommandFlag::ghost)
|
||||
&& !getGameState().cheats.disableClearanceChecks)
|
||||
{
|
||||
FootpathRemoveLitter({ _loc, z });
|
||||
@@ -224,7 +224,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
FootpathQueueChainReset();
|
||||
|
||||
if (!(GetFlags().has(CommandFlag::ghost)))
|
||||
if (!GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
MazeEntranceHedgeRemoval({ _loc, entranceElement->as<TileElement>() });
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ namespace OpenRCT2::GameActions
|
||||
targetHeight = surfaceHeight;
|
||||
}
|
||||
|
||||
if (!(GetFlags().has(CommandFlag::ghost)))
|
||||
if (!GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
FootpathRemoveLitter({ _loc, targetHeight });
|
||||
if (!getGameState().cheats.disableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_WALLS)))
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace OpenRCT2::GameActions
|
||||
res.expenditure = ExpenditureType::landscaping;
|
||||
res.position = _loc;
|
||||
|
||||
if (gLegacyScene != LegacyScene::scenarioEditor && !(GetFlags().has(CommandFlag::ghost))
|
||||
if (gLegacyScene != LegacyScene::scenarioEditor && !GetFlags().has(CommandFlag::ghost)
|
||||
&& !getGameState().cheats.sandboxMode)
|
||||
{
|
||||
// Check if allowed to remove item
|
||||
|
||||
@@ -477,7 +477,7 @@ namespace OpenRCT2::GameActions
|
||||
costs += canBuild.cost;
|
||||
|
||||
// When building a level crossing, remove any pre-existing path furniture.
|
||||
if (crossingMode == CreateCrossingMode::trackOverPath && !(GetFlags().has(CommandFlag::ghost)))
|
||||
if (crossingMode == CreateCrossingMode::trackOverPath && !GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
auto footpathElement = MapGetFootpathElement(mapLoc);
|
||||
if (footpathElement != nullptr && footpathElement->HasAddition())
|
||||
@@ -486,7 +486,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
}
|
||||
|
||||
if (!(GetFlags().has(CommandFlag::ghost)) && !gameState.cheats.disableClearanceChecks)
|
||||
if (!GetFlags().has(CommandFlag::ghost) && !gameState.cheats.disableClearanceChecks)
|
||||
{
|
||||
FootpathRemoveLitter(mapLoc);
|
||||
if (rtd.HasFlag(RtdFlag::noWallsAroundTrack))
|
||||
@@ -542,7 +542,7 @@ namespace OpenRCT2::GameActions
|
||||
bool isOrigin = false;
|
||||
if (!ride->overallView.IsNull())
|
||||
{
|
||||
if (!(GetFlags().has(CommandFlag::noSpend)))
|
||||
if (!GetFlags().has(CommandFlag::noSpend))
|
||||
{
|
||||
isOrigin = ted.sequences[0].flags.has(SequenceFlag::trackOrigin);
|
||||
}
|
||||
@@ -611,7 +611,7 @@ namespace OpenRCT2::GameActions
|
||||
uint32_t connectionSides = ted.sequences[0].getEntranceConnectionSides();
|
||||
if (connectionSides != 0)
|
||||
{
|
||||
if (!(GetFlags().has(CommandFlag::ghost)) && !gameState.cheats.disableClearanceChecks)
|
||||
if (!GetFlags().has(CommandFlag::ghost) && !gameState.cheats.disableClearanceChecks)
|
||||
{
|
||||
for (int32_t chosenDirection = Numerics::bitScanForward(connectionSides); chosenDirection != -1;
|
||||
chosenDirection = Numerics::bitScanForward(connectionSides))
|
||||
@@ -632,7 +632,7 @@ namespace OpenRCT2::GameActions
|
||||
// Don't do this if the tile is a ghost to prevent desyncs
|
||||
// However, ghost tiles from track designs need to modify station data to display properly
|
||||
if (ted.sequences[0].flags.has(SequenceFlag::trackOrigin)
|
||||
&& (!(GetFlags().has(CommandFlag::ghost)) || _fromTrackDesign))
|
||||
&& (!GetFlags().has(CommandFlag::ghost) || _fromTrackDesign))
|
||||
{
|
||||
if (blockIndex == 0)
|
||||
{
|
||||
@@ -654,7 +654,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
}
|
||||
|
||||
if (!gameState.cheats.disableClearanceChecks || !(GetFlags().has(CommandFlag::ghost)))
|
||||
if (!gameState.cheats.disableClearanceChecks || !GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
FootpathConnectEdges(mapLoc, tileElement, GetFlags());
|
||||
}
|
||||
@@ -662,7 +662,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
|
||||
// Update ride stats and block brake count if the piece was successfully built
|
||||
if (!(GetFlags().has(CommandFlag::ghost)))
|
||||
if (!GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
switch (_trackType)
|
||||
{
|
||||
|
||||
@@ -405,7 +405,7 @@ namespace OpenRCT2::GameActions
|
||||
// If the removed tile is a station modify station properties.
|
||||
// Don't do this if the ride is simulating and the tile is a ghost to prevent desyncs.
|
||||
if (ted.sequences[0].flags.has(SequenceFlag::trackOrigin)
|
||||
&& (!(GetFlags().has(CommandFlag::ghost)) || (GetFlags().has(CommandFlag::trackDesign)))
|
||||
&& (!GetFlags().has(CommandFlag::ghost) || (GetFlags().has(CommandFlag::trackDesign)))
|
||||
&& (tileElement->AsTrack()->GetSequenceIndex() == 0))
|
||||
{
|
||||
const auto removeElementResult = TrackRemoveStationElement(
|
||||
@@ -429,13 +429,13 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
TileElementRemove(tileElement);
|
||||
ride->validateStations();
|
||||
if (!(GetFlags().has(CommandFlag::ghost)))
|
||||
if (!GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
ride->updateMaxVehicles();
|
||||
}
|
||||
}
|
||||
|
||||
if (!(GetFlags().has(CommandFlag::ghost)))
|
||||
if (!GetFlags().has(CommandFlag::ghost))
|
||||
{
|
||||
switch (trackType)
|
||||
{
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace OpenRCT2::GameActions
|
||||
}
|
||||
|
||||
auto mapSizeMax = GetMapSizeMaxXY();
|
||||
if (gLegacyScene != LegacyScene::scenarioEditor && !(GetFlags().has(CommandFlag::trackDesign))
|
||||
if (gLegacyScene != LegacyScene::scenarioEditor && !GetFlags().has(CommandFlag::trackDesign)
|
||||
&& !gameState.cheats.sandboxMode)
|
||||
{
|
||||
if (_loc.z == 0)
|
||||
@@ -252,7 +252,7 @@ namespace OpenRCT2::GameActions
|
||||
clearanceHeight += wallEntry->height;
|
||||
|
||||
bool wallAcrossTrack = false;
|
||||
if (!(GetFlags().has(CommandFlag::trackDesign)) && !gameState.cheats.disableClearanceChecks)
|
||||
if (!GetFlags().has(CommandFlag::trackDesign) && !gameState.cheats.disableClearanceChecks)
|
||||
{
|
||||
auto result = WallCheckObstruction(wallEntry, targetHeight / 8, clearanceHeight, &wallAcrossTrack);
|
||||
if (result.error != Status::ok)
|
||||
@@ -326,7 +326,7 @@ namespace OpenRCT2::GameActions
|
||||
clearanceHeight += wallEntry->height;
|
||||
|
||||
bool wallAcrossTrack = false;
|
||||
if (!(GetFlags().has(CommandFlag::trackDesign)) && !gameState.cheats.disableClearanceChecks)
|
||||
if (!GetFlags().has(CommandFlag::trackDesign) && !gameState.cheats.disableClearanceChecks)
|
||||
{
|
||||
auto result = WallCheckObstruction(wallEntry, targetHeight / kCoordsZStep, clearanceHeight, &wallAcrossTrack);
|
||||
if (result.error != Status::ok)
|
||||
|
||||
@@ -182,7 +182,7 @@ void JumpingFountain::Update()
|
||||
{
|
||||
AdvanceAnimation();
|
||||
}
|
||||
if (frame == 16 && !(fountainFlags.has(FountainFlag::fast)))
|
||||
if (frame == 16 && !fountainFlags.has(FountainFlag::fast))
|
||||
{
|
||||
AdvanceAnimation();
|
||||
}
|
||||
|
||||
@@ -416,7 +416,7 @@ namespace OpenRCT2
|
||||
for (; it != gWindowList.end(); it++)
|
||||
{
|
||||
auto w = it->get();
|
||||
if (!(w->flags.has(WindowFlag::transparent)) || (w->flags.has(WindowFlag::dead)))
|
||||
if (!w->flags.has(WindowFlag::transparent) || (w->flags.has(WindowFlag::dead)))
|
||||
continue;
|
||||
if (w->viewport == window->viewport)
|
||||
continue;
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace OpenRCT2
|
||||
|
||||
bool IsVisible() const
|
||||
{
|
||||
return !(flags.has(OpenRCT2::WidgetFlag::isHidden));
|
||||
return !flags.has(OpenRCT2::WidgetFlag::isHidden);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -405,7 +405,7 @@ static constexpr float kWindowScrollLocations[][2] = {
|
||||
// rct2: 0x006E7C76
|
||||
if (w.viewportTargetSprite.IsNull())
|
||||
{
|
||||
if (!(w.flags.has(WindowFlag::noScrolling)))
|
||||
if (!w.flags.has(WindowFlag::noScrolling))
|
||||
{
|
||||
w.savedViewPos = screenCoords
|
||||
- ScreenCoordsXY{ static_cast<int32_t>(w.viewport->ViewWidth() * kWindowScrollLocations[i][0]),
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace OpenRCT2
|
||||
|
||||
int16_t WindowBase::getTitleBarCurrentHeight() const
|
||||
{
|
||||
if (!(flags.has(WindowFlag::noTitleBar)) && widgets.size() > 2)
|
||||
if (!flags.has(WindowFlag::noTitleBar) && widgets.size() > 2)
|
||||
return widgets[1].height() - 1;
|
||||
else
|
||||
return 0;
|
||||
|
||||
@@ -1134,7 +1134,7 @@ namespace OpenRCT2::RCT2
|
||||
dst->type = RCTEntryIndexToOpenRCT2EntryIndex(src->Type);
|
||||
dst->flags = src->flags;
|
||||
|
||||
if (!(src->flags.has(BannerFlag::linkedToRide)) && IsUserStringID(src->StringID))
|
||||
if (!src->flags.has(BannerFlag::linkedToRide) && IsUserStringID(src->StringID))
|
||||
{
|
||||
dst->text = GetUserString(src->StringID);
|
||||
}
|
||||
|
||||
@@ -925,7 +925,7 @@ int32_t Ride::getTotalTime() const
|
||||
|
||||
bool Ride::canHaveMultipleCircuits() const
|
||||
{
|
||||
if (!(getRideTypeDescriptor().HasFlag(RtdFlag::allowMultipleCircuits)))
|
||||
if (!getRideTypeDescriptor().HasFlag(RtdFlag::allowMultipleCircuits))
|
||||
return false;
|
||||
|
||||
// Only allow circuit or launch modes
|
||||
@@ -5199,7 +5199,7 @@ void Ride::updateMaxVehicles()
|
||||
} while (totalLength <= stationLength);
|
||||
|
||||
if ((mode != RideMode::stationToStation && mode != RideMode::continuousCircuit)
|
||||
|| !(rtd.HasFlag(RtdFlag::allowMoreVehiclesThanStationFits)))
|
||||
|| !rtd.HasFlag(RtdFlag::allowMoreVehiclesThanStationFits))
|
||||
{
|
||||
maxNumTrains = std::min(maxNumTrains, int32_t(OpenRCT2::Limits::kMaxTrainsPerRide));
|
||||
}
|
||||
|
||||
@@ -332,7 +332,7 @@ ResultWithMessage TrackRemoveStationElement(const CoordsXYZD& loc, RideId rideIn
|
||||
}
|
||||
} while (stationElement != nullptr);
|
||||
|
||||
if (!(flags.has(CommandFlag::apply)))
|
||||
if (!flags.has(CommandFlag::apply))
|
||||
{
|
||||
if ((removeLoc != stationBackLoc) && (removeLoc != stationFrontLoc) && ride->numStations >= Limits::kMaxStationsPerRide)
|
||||
{
|
||||
|
||||
@@ -615,7 +615,7 @@ void Vehicle::UpdateMeasurements()
|
||||
auto trackElemType = GetTrackType();
|
||||
if (trackElemType == TrackElemType::PoweredLift || HasFlag(VehicleFlags::OnLiftHill))
|
||||
{
|
||||
if (!(curRide->testingFlags.has(RideTestingFlag::poweredLift)))
|
||||
if (!curRide->testingFlags.has(RideTestingFlag::poweredLift))
|
||||
{
|
||||
curRide->testingFlags.set(RideTestingFlag::poweredLift);
|
||||
if (curRide->numPoweredLifts < OpenRCT2::Limits::kRideMaxNumPoweredLiftsCount)
|
||||
@@ -677,10 +677,10 @@ void Vehicle::UpdateMeasurements()
|
||||
RideTestingFlag::turnSloped);
|
||||
|
||||
uint8_t turnType = 1;
|
||||
if (!(testingFlags.has(RideTestingFlag::turnBanked)))
|
||||
if (!testingFlags.has(RideTestingFlag::turnBanked))
|
||||
{
|
||||
turnType = 2;
|
||||
if (!(testingFlags.has(RideTestingFlag::turnSloped)))
|
||||
if (!testingFlags.has(RideTestingFlag::turnSloped))
|
||||
{
|
||||
turnType = 0;
|
||||
}
|
||||
@@ -858,7 +858,7 @@ void Vehicle::UpdateMeasurements()
|
||||
}
|
||||
}
|
||||
|
||||
if (!(curRide->testingFlags.has(RideTestingFlag::sheltered)))
|
||||
if (!curRide->testingFlags.has(RideTestingFlag::sheltered))
|
||||
{
|
||||
curRide->testingFlags.set(RideTestingFlag::sheltered);
|
||||
|
||||
@@ -6502,7 +6502,7 @@ void Vehicle::Sub6DBF3E()
|
||||
|
||||
auto trackType = GetTrackType();
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
if (!(ted.sequences[0].flags.has(SequenceFlag::trackOrigin)))
|
||||
if (!ted.sequences[0].flags.has(SequenceFlag::trackOrigin))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -7906,7 +7906,7 @@ void Vehicle::Loc6DCE02(const Ride& curRide)
|
||||
|
||||
auto trackType = GetTrackType();
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
if (!(ted.sequences[0].flags.has(SequenceFlag::trackOrigin)))
|
||||
if (!ted.sequences[0].flags.has(SequenceFlag::trackOrigin))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ static bool MapPlaceClearFunc(
|
||||
if ((*tile_element)->GetType() != TileElementType::SmallScenery)
|
||||
return false;
|
||||
|
||||
if (is_scenery && !(flags.has(CommandFlag::trackDesign)))
|
||||
if (is_scenery && !flags.has(CommandFlag::trackDesign))
|
||||
return false;
|
||||
|
||||
auto* scenery = (*tile_element)->AsSmallScenery()->GetEntry();
|
||||
@@ -61,7 +61,7 @@ static bool MapPlaceClearFunc(
|
||||
if (flags.has(CommandFlag::ghost))
|
||||
return true;
|
||||
|
||||
if (!(flags.has(CommandFlag::apply)))
|
||||
if (!flags.has(CommandFlag::apply))
|
||||
return true;
|
||||
|
||||
MapInvalidateTile({ coords, (*tile_element)->GetBaseZ(), (*tile_element)->GetClearanceZ() });
|
||||
|
||||
@@ -526,7 +526,7 @@ static void Loc6A6F1F(
|
||||
FootpathQueueChainPush(tileElement->AsPath()->GetRideIndex());
|
||||
}
|
||||
}
|
||||
if (!(flags.hasAny(CommandFlag::ghost, CommandFlag::allowDuringPaused)))
|
||||
if (!flags.hasAny(CommandFlag::ghost, CommandFlag::allowDuringPaused))
|
||||
{
|
||||
FootpathInterruptPeeps({ targetPos, tileElement->GetBaseZ() });
|
||||
}
|
||||
@@ -596,7 +596,7 @@ static void Loc6A6D7E(
|
||||
const auto trackType = tileElement->AsTrack()->GetTrackType();
|
||||
const uint8_t trackSequence = tileElement->AsTrack()->GetSequenceIndex();
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
if (!(ted.sequences[trackSequence].flags.has(SequenceFlag::connectsToPath)))
|
||||
if (!ted.sequences[trackSequence].flags.has(SequenceFlag::connectsToPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -682,7 +682,7 @@ static void Loc6A6C85(
|
||||
const auto trackType = tileElementPos.element->AsTrack()->GetTrackType();
|
||||
const uint8_t trackSequence = tileElementPos.element->AsTrack()->GetSequenceIndex();
|
||||
const auto& ted = GetTrackElementDescriptor(trackType);
|
||||
if (!(ted.sequences[trackSequence].flags.has(SequenceFlag::connectsToPath)))
|
||||
if (!ted.sequences[trackSequence].flags.has(SequenceFlag::connectsToPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user