diff --git a/Source/Entities/ADoor.cpp b/Source/Entities/ADoor.cpp index 8425c21942..095f601ba5 100644 --- a/Source/Entities/ADoor.cpp +++ b/Source/Entities/ADoor.cpp @@ -465,11 +465,6 @@ void ADoor::Update() { Actor::Update(); - // Start the spinning out of control animation for the motor, start it slow - if (!m_Door) { - m_SpriteAnimDuration *= 4; - } - if (m_SpriteAnimMode == LOOPWHENOPENCLOSE && m_FrameCount > 1 && (m_DoorState == OPENING || m_DoorState == CLOSING) && m_SpriteAnimTimer.IsPastSimMS(m_SpriteAnimDuration)) { m_Frame = (m_Frame + 1) % m_FrameCount; m_SpriteAnimTimer.Reset(); diff --git a/Source/Entities/Actor.cpp b/Source/Entities/Actor.cpp index 1ea044ee05..7ea36f424b 100644 --- a/Source/Entities/Actor.cpp +++ b/Source/Entities/Actor.cpp @@ -1047,6 +1047,7 @@ float Actor::EstimateDigStrength() const { } float Actor::EstimateJumpHeight() const { + // Sentinel value that is explicitly checked for within pathfinder code. return FLT_MAX; } diff --git a/Source/Entities/Actor.h b/Source/Entities/Actor.h index dfaa802979..00be2213e7 100644 --- a/Source/Entities/Actor.h +++ b/Source/Entities/Actor.h @@ -668,7 +668,7 @@ namespace RTE { /// @return The actor's dig strength. virtual float EstimateDigStrength() const; - /// Estimates how high this actor can jump. + /// Estimates how high this actor can jump. Default implementation returns FLT_MAX. /// @return The actor's jump height. virtual float EstimateJumpHeight() const; diff --git a/Source/Managers/WindowMan.cpp b/Source/Managers/WindowMan.cpp index bfd3a2da11..2b80a62be6 100644 --- a/Source/Managers/WindowMan.cpp +++ b/Source/Managers/WindowMan.cpp @@ -675,12 +675,14 @@ void WindowMan::DisplaySwitchOut() const { SDL_SetCursor(nullptr); } -void WindowMan::HandleWindowExposedEvent(void *userdata, SDL_Event *event) { +bool WindowMan::HandleWindowExposedEvent(void *userdata, SDL_Event *event) { if (event->type == SDL_EVENT_WINDOW_EXPOSED) { g_WindowMan.SetViewportLetterboxed(); g_WindowMan.ClearBackbuffer(false); g_WindowMan.UploadFrame(); } + + return true; } void WindowMan::QueueWindowEvent(const SDL_Event& windowEvent) { diff --git a/Source/Managers/WindowMan.h b/Source/Managers/WindowMan.h index 3295c1ef44..53452dbed2 100644 --- a/Source/Managers/WindowMan.h +++ b/Source/Managers/WindowMan.h @@ -168,8 +168,8 @@ namespace RTE { #pragma endregion #pragma region Concrete Methods - /// SDL_EventFilter to hadnle window exposed events for live resize. - static void HandleWindowExposedEvent(void* userdata, SDL_Event* event); + /// SDL_EventFilter to handle window exposed events for live resize. + static bool HandleWindowExposedEvent(void* userdata, SDL_Event* event); /// Adds an SDL_Event to the Event queue for processing on Update. /// @param windowEvent The SDL window event to queue. diff --git a/Source/Menus/ScenarioActivityConfigGUI.cpp b/Source/Menus/ScenarioActivityConfigGUI.cpp index 916e999746..6d675ce237 100644 --- a/Source/Menus/ScenarioActivityConfigGUI.cpp +++ b/Source/Menus/ScenarioActivityConfigGUI.cpp @@ -65,8 +65,6 @@ ScenarioActivityConfigGUI::ScenarioActivityConfigGUI(GUIControlManager* parentCo m_CPULockLabel = dynamic_cast(m_GUIControlManager->GetControl("LabelCPUTeamLock")); m_StartErrorLabel = dynamic_cast(m_GUIControlManager->GetControl("LabelStartError")); m_StartGameButton = dynamic_cast(m_GUIControlManager->GetControl("ButtonStartGame")); - - m_TechListFetched = false; } void ScenarioActivityConfigGUI::PopulateTechComboBoxes() { diff --git a/Source/Menus/ScenarioActivityConfigGUI.h b/Source/Menus/ScenarioActivityConfigGUI.h index ae9147221e..62b2fea672 100644 --- a/Source/Menus/ScenarioActivityConfigGUI.h +++ b/Source/Menus/ScenarioActivityConfigGUI.h @@ -65,16 +65,16 @@ namespace RTE { GUIControlManager* m_GUIControlManager; //!< The GUIControlManager which holds all the GUIControls of this menu. Not owned by this. - const GameActivity* m_SelectedActivity; //!< The Activity this ScenarioActivityConfigGUI is configuring. - const GameActivity* m_PreviouslySelectedActivity; //!< The Activity this ScenarioActivityConfigGUI was configuring last, before it got was disabled. - Scene* m_SelectedScene; //!< The Scene the selected Activity will be using. - int m_LockedCPUTeam = Activity::Teams::NoTeam; //!< Which team the CPU is locked to, if any. + const GameActivity* m_SelectedActivity {}; //!< The Activity this ScenarioActivityConfigGUI is configuring. + const GameActivity* m_PreviouslySelectedActivity {}; //!< The Activity this ScenarioActivityConfigGUI was configuring last, before it got was disabled. + Scene* m_SelectedScene {}; //!< The Scene the selected Activity will be using. + int m_LockedCPUTeam { Activity::Teams::NoTeam }; //!< Which team the CPU is locked to, if any. bool m_StartingGoldAdjustedManually {}; //!< Whether the player adjusted the starting gold, meaning it should stop automatically adjusting to the difficulty setting default starting gold where applicable. Timer m_StartGameButtonBlinkTimer; //!< Timer for blinking the start game button. - bool m_TechListFetched; //!< Whether the tech list was fetched and each team's ComboBox was populated with it, even if no valid tech modules were added. + bool m_TechListFetched {}; //!< Whether the tech list was fetched and each team's ComboBox was populated with it, even if no valid tech modules were added. /// GUI elements that compose the Activity setup box. GUICollectionBox* m_ActivityConfigBox; diff --git a/Source/System/PathFinder.cpp b/Source/System/PathFinder.cpp index 843895c145..c62653b9a1 100644 --- a/Source/System/PathFinder.cpp +++ b/Source/System/PathFinder.cpp @@ -172,9 +172,16 @@ int PathFinder::CalculatePath(Vector start, Vector end, std::list& pathR // Actors capable of jumping/jetpacking can jump upwards. s_JumpHeight = jumpHeight; - // How high up we can jump from this node - s_JumpHeightVertical = std::max(1, static_cast(jumpHeight / (m_NodeDimension * c_MPP))); // min of 1 so automovers work a bit better - s_JumpHeightDiagonal = std::max(1, static_cast((jumpHeight * 0.7F) / (m_NodeDimension * c_MPP))); + // How high up we can jump from this node. + if(jumpHeight == FLT_MAX) { + // Probably quite high. + s_JumpHeightVertical = INT_MAX; + s_JumpHeightDiagonal = INT_MAX; + } else { + // Assume at least 1 so automovers work a bit better + s_JumpHeightVertical = std::max(1, static_cast(jumpHeight / (m_NodeDimension * c_MPP))); + s_JumpHeightDiagonal = std::max(1, static_cast((jumpHeight * 0.7F) / (m_NodeDimension * c_MPP))); + } // Actors capable of digging can use s_DigStrength to modify the node adjacency cost. s_DigStrength = digStrength;