From 83fd574949df77dbd64405bd0d582402a8c07ba7 Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Sun, 18 Jan 2026 15:57:16 +0100 Subject: [PATCH 1/2] Fixed warnings - without logic change. --- .../GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp | 2 +- .../GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp | 2 +- .../Code/GameEngine/Source/GameClient/Input/Mouse.cpp | 2 +- .../Source/GameClient/MessageStream/CommandXlat.cpp | 6 +++--- .../Object/Update/AIUpdate/DeployStyleAIUpdate.cpp | 2 +- .../GameLogic/Object/Update/SpecialAbilityUpdate.cpp | 4 ++-- .../Code/GameEngine/Source/GameLogic/Object/Weapon.cpp | 2 +- .../Source/GameLogic/ScriptEngine/ScriptActions.cpp | 7 +++---- Generals/Code/Tools/GUIEdit/Source/HierarchyView.cpp | 2 +- .../GameEngine/Source/Common/System/BuildAssistant.cpp | 2 +- .../GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp | 2 +- .../GUI/GUICallbacks/Menus/WOLGameSetupMenu.cpp | 2 +- GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp | 8 ++++---- .../Code/GameEngine/Source/GameClient/Input/Mouse.cpp | 2 +- .../Source/GameClient/MessageStream/CommandXlat.cpp | 6 +++--- .../GameLogic/Object/Behavior/FlightDeckBehavior.cpp | 4 ++-- .../Code/GameEngine/Source/GameLogic/Object/Object.cpp | 7 ++++++- .../Source/GameLogic/Object/Update/AIUpdate.cpp | 2 +- .../GameLogic/Object/Update/SpecialAbilityUpdate.cpp | 4 ++-- .../Code/GameEngine/Source/GameLogic/Object/Weapon.cpp | 4 ++-- .../Source/GameLogic/ScriptEngine/ScriptActions.cpp | 7 +++---- GeneralsMD/Code/Tools/GUIEdit/Source/HierarchyView.cpp | 2 +- 22 files changed, 42 insertions(+), 39 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp index 2c2a7e96c4d..1d9df298e12 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp @@ -159,7 +159,7 @@ static Int getNextSelectablePlayer(Int start) static Int getFirstSelectablePlayer(const GameInfo *game) { const GameSlot *slot = game->getConstSlot(game->getLocalSlotNum()); - if (!game->amIHost() || slot && slot->getPlayerTemplate() != PLAYERTEMPLATE_OBSERVER) + if (!game->amIHost() || (slot && slot->getPlayerTemplate() != PLAYERTEMPLATE_OBSERVER)) return game->getLocalSlotNum(); for (Int i=0; igetConstSlot(game->getLocalSlotNum()); - if (!game->amIHost() || slot && slot->getPlayerTemplate() != PLAYERTEMPLATE_OBSERVER) + if (!game->amIHost() || (slot && slot->getPlayerTemplate() != PLAYERTEMPLATE_OBSERVER)) return game->getLocalSlotNum(); for (Int i=0; igetText())) + if (forceRecalc || (!m_isTooltipEmpty && tooltip.compare(m_tooltipDisplayString->getText()))) { m_tooltipDisplayString->setText(tooltip); //DEBUG_LOG(("Tooltip: %ls", tooltip.str())); diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp index 7e3e99eb2e9..d554387cd3c 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp @@ -1495,8 +1495,8 @@ GameMessage::Type CommandTranslator::evaluateContextCommand( Drawable *draw, //Added: shrubberies are the exception for interactions... //Removed: GS Took out ObjectStatusUnselectable, since that status only prevents selection, not everything if( obj == nullptr || - obj->getStatusBits().test( OBJECT_STATUS_MASKED ) && - !obj->isKindOf(KINDOF_SHRUBBERY) && !obj->isKindOf(KINDOF_FORCEATTACKABLE) ) + ( obj->getStatusBits().test( OBJECT_STATUS_MASKED ) && + !obj->isKindOf(KINDOF_SHRUBBERY) && !obj->isKindOf(KINDOF_FORCEATTACKABLE) ) ) { //Nulling out the draw and obj pointer will force the remainder of this code to evaluate //a position interaction. @@ -3049,7 +3049,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage if (TheGameLogic->isInMultiplayerGame() && !TheGameLogic->isInReplayGame()) { Player *localPlayer = ThePlayerList->getLocalPlayer(); - if (localPlayer && localPlayer->isPlayerActive() || !TheGlobalData->m_netMinPlayers) + if ((localPlayer && localPlayer->isPlayerActive()) || !TheGlobalData->m_netMinPlayers) { ToggleInGameChat(); SetInGameChatType( INGAME_CHAT_ALLIES ); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeployStyleAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeployStyleAIUpdate.cpp index 2b29c968967..2e4c7473550 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeployStyleAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeployStyleAIUpdate.cpp @@ -264,7 +264,7 @@ UpdateSleepTime DeployStyleAIUpdate::update( void ) break; case READY_TO_ATTACK: - if( !remainDeployed && (!inRange && isAttacking || !isAttacking && (isWaitingForPath() || getPath())) ) + if( !remainDeployed && ((!inRange && isAttacking) || (!isAttacking && (isWaitingForPath() || getPath()))) ) { WhichTurretType tur = getWhichTurretForCurWeapon(); if( tur != TURRET_INVALID ) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp index 904df0b1937..d10dc994ce6 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp @@ -422,7 +422,7 @@ Bool SpecialAbilityUpdate::initiateIntentToDoSpecialPower( const SpecialPowerTem //Determine whether we are triggering a command (rather than executing special at location or target) m_noTargetCommand = !targetObj && !targetPos; - if( data->m_unpackTime == 0 || m_noTargetCommand && data->m_skipPackingWithNoTarget ) + if( data->m_unpackTime == 0 || (m_noTargetCommand && data->m_skipPackingWithNoTarget) ) { //Only unpack if we need to -- setting it to unpacked will skip step 2 in the update m_packingState = STATE_UNPACKED; @@ -499,7 +499,7 @@ void SpecialAbilityUpdate::onExit( Bool cleanup ) TheAudio->removeAudioEvent( m_prepSoundLoop.getPlayingHandle() ); endPreparation(); - if( !data->m_specialObjectsPersistent || cleanup && !data->m_specialObjectsPersistWhenOwnerDies ) + if( !data->m_specialObjectsPersistent || (cleanup && !data->m_specialObjectsPersistWhenOwnerDies) ) { //Delete special objects that aren't considered persistent whenever we turn off //leave the special ability update. diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 0551f708a57..3614632580d 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -1022,7 +1022,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate firingWeapon->newProjectileFired( sourceObj, projectile );//The actual logic weapon needs to know this was created. - if( m_scatterRadius > 0.0f || m_infantryInaccuracyDist > 0.0f && victimObj && victimObj->isKindOf( KINDOF_INFANTRY ) ) + if( m_scatterRadius > 0.0f || ( m_infantryInaccuracyDist > 0.0f && victimObj && victimObj->isKindOf( KINDOF_INFANTRY ) ) ) { // This weapon scatters, so clear the victimObj, as we are no longer shooting it directly, // and find a random point within the radius to shoot at as victimPos diff --git a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp index 5aa14860a19..839c22faf14 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp @@ -3299,8 +3299,7 @@ void ScriptActions::doTeamGarrisonSpecificBuilding(const AsciiString& teamName, } PlayerMaskType player = theBuilding->getContain()->getPlayerWhoEntered(); - if (!(theBuilding->isKindOf(KINDOF_STRUCTURE) && - (player == 0) || (player == theTeam->getControllingPlayer()->getPlayerMask()))) { + if (!theBuilding->isKindOf(KINDOF_STRUCTURE) || (player != 0 && player != theTeam->getControllingPlayer()->getPlayerMask())) { return; } @@ -3446,10 +3445,10 @@ void ScriptActions::doUnitGarrisonSpecificBuilding(const AsciiString& unitName, } PlayerMaskType player = theBuilding->getContain()->getPlayerWhoEntered(); - if (!(theBuilding->isKindOf(KINDOF_STRUCTURE) && - (player == 0) || (player == theUnit->getControllingPlayer()->getPlayerMask()))) { + if (!theBuilding->isKindOf(KINDOF_STRUCTURE) || (player != 0 && player != theUnit->getControllingPlayer()->getPlayerMask())) { return; } + AIUpdateInterface *ai = theUnit->getAIUpdateInterface(); if (!ai) { return; diff --git a/Generals/Code/Tools/GUIEdit/Source/HierarchyView.cpp b/Generals/Code/Tools/GUIEdit/Source/HierarchyView.cpp index dd8a84b8787..3f6ecce7196 100644 --- a/Generals/Code/Tools/GUIEdit/Source/HierarchyView.cpp +++ b/Generals/Code/Tools/GUIEdit/Source/HierarchyView.cpp @@ -710,7 +710,7 @@ void HierarchyView::addWindowToTree( GameWindow *window, // add children if requested, but not on gadgets no matter what because // they are "atomic units", except for tab controls. // - if( addChildren && TheEditor->windowIsGadget( window ) == FALSE || (window->winGetStyle() & GWS_TAB_CONTROL) ) + if( (addChildren && TheEditor->windowIsGadget( window ) == FALSE) || (window->winGetStyle() & GWS_TAB_CONTROL) ) { GameWindow *child; diff --git a/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp b/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp index cff82dadd90..73f6cd57c5b 100644 --- a/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp +++ b/GeneralsMD/Code/GameEngine/Source/Common/System/BuildAssistant.cpp @@ -719,7 +719,7 @@ LegalBuildCode BuildAssistant::isLocationClearOfObjects( const Coord3D *worldPos //Prevent busy units (black lotus hacking from being moved by trying to place a building -- exploit). if (rel == ALLIES) { - if (them->testStatus(OBJECT_STATUS_IS_USING_ABILITY) || them->getAI() && them->getAI()->isBusy()) + if (them->testStatus(OBJECT_STATUS_IS_USING_ABILITY) || (them->getAI() && them->getAI()->isBusy())) { return LBC_OBJECTS_IN_THE_WAY; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp index f38ccb5157d..3deebf2c917 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/LanGameOptionsMenu.cpp @@ -166,7 +166,7 @@ static Int getNextSelectablePlayer(Int start) static Int getFirstSelectablePlayer(const GameInfo *game) { const GameSlot *slot = game->getConstSlot(game->getLocalSlotNum()); - if (!game->amIHost() || slot && slot->getPlayerTemplate() != PLAYERTEMPLATE_OBSERVER) + if (!game->amIHost() || (slot && slot->getPlayerTemplate() != PLAYERTEMPLATE_OBSERVER)) return game->getLocalSlotNum(); for (Int i=0; igetConstSlot(game->getLocalSlotNum()); - if (!game->amIHost() || slot && slot->getPlayerTemplate() != PLAYERTEMPLATE_OBSERVER) + if (!game->amIHost() || (slot && slot->getPlayerTemplate() != PLAYERTEMPLATE_OBSERVER)) return game->getLocalSlotNum(); for (Int i=0; igetText())) + if (forceRecalc || (!m_isTooltipEmpty && tooltip.compare(m_tooltipDisplayString->getText()))) { m_tooltipDisplayString->setText(tooltip); //DEBUG_LOG(("Tooltip: %ls", tooltip.str())); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp index df0d7a19486..7b48c8be309 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp @@ -1576,8 +1576,8 @@ GameMessage::Type CommandTranslator::evaluateContextCommand( Drawable *draw, //Added: shrubberies are the exception for interactions... //Removed: GS Took out ObjectStatusUnselectable, since that status only prevents selection, not everything if( obj == nullptr || - obj->getStatusBits().test( OBJECT_STATUS_MASKED ) && - !obj->isKindOf(KINDOF_SHRUBBERY) && !obj->isKindOf(KINDOF_FORCEATTACKABLE) ) + ( obj->getStatusBits().test( OBJECT_STATUS_MASKED ) && + !obj->isKindOf(KINDOF_SHRUBBERY) && !obj->isKindOf(KINDOF_FORCEATTACKABLE) ) ) { //Nulling out the draw and obj pointer will force the remainder of this code to evaluate //a position interaction. @@ -3195,7 +3195,7 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage if (TheGameLogic->isInMultiplayerGame() && !TheGameLogic->isInReplayGame()) { Player *localPlayer = ThePlayerList->getLocalPlayer(); - if (localPlayer && localPlayer->isPlayerActive() || !TheGlobalData->m_netMinPlayers) + if ((localPlayer && localPlayer->isPlayerActive()) || !TheGlobalData->m_netMinPlayers) { ToggleInGameChat(); SetInGameChatType( INGAME_CHAT_ALLIES ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp index 59cdbe0e14f..e310fa0351c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/FlightDeckBehavior.cpp @@ -679,11 +679,11 @@ Bool FlightDeckBehavior::reserveRunway(ObjectID id, Bool forLanding) } RunwayInfo& info = m_runways[runway]; - if( info.m_inUseByForTakeoff == id && !forLanding || info.m_inUseByForLanding == id && forLanding ) + if( (info.m_inUseByForTakeoff == id && !forLanding) || (info.m_inUseByForLanding == id && forLanding) ) { return true; } - else if( info.m_inUseByForTakeoff == INVALID_ID && !forLanding || info.m_inUseByForLanding == INVALID_ID && forLanding ) + else if( (info.m_inUseByForTakeoff == INVALID_ID && !forLanding) || (info.m_inUseByForLanding == INVALID_ID && forLanding) ) { if( forLanding ) { diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp index e11db7d4c53..a176b164e66 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp @@ -5917,8 +5917,13 @@ SpecialPowerModuleInterface* Object::findSpecialPowerModuleInterface( SpecialPow if (!sp) continue; + if (type == SPECIAL_INVALID) + { + return sp; + } + const SpecialPowerTemplate *spTemplate = sp->getSpecialPowerTemplate(); - if (spTemplate && spTemplate->getSpecialPowerType() == type || type == SPECIAL_INVALID ) + if (spTemplate && spTemplate->getSpecialPowerType() == type) { return sp; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp index 28784f1907e..133cc07a229 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp @@ -1476,7 +1476,7 @@ Bool AIUpdateInterface::processCollision(PhysicsBehavior *physics, Object *other { //Kris: Patch 1.01 -- November 5, 2003 //Prevent busy units from being told to move out of the way! - if( other->testStatus( OBJECT_STATUS_IS_USING_ABILITY ) || other->getAI() && other->getAI()->isBusy() ) + if( other->testStatus( OBJECT_STATUS_IS_USING_ABILITY ) || (other->getAI() && other->getAI()->isBusy()) ) { return FALSE; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp index 0fc36ff7929..eb17ff3ea41 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/SpecialAbilityUpdate.cpp @@ -520,7 +520,7 @@ Bool SpecialAbilityUpdate::initiateIntentToDoSpecialPower( const SpecialPowerTem //Determine whether we are triggering a command (rather than executing special at location or target) m_noTargetCommand = !targetObj && !targetPos; - if( data->m_unpackTime == 0 || m_noTargetCommand && data->m_skipPackingWithNoTarget ) + if( data->m_unpackTime == 0 || (m_noTargetCommand && data->m_skipPackingWithNoTarget) ) { //Only unpack if we need to -- setting it to unpacked will skip step 2 in the update m_packingState = STATE_UNPACKED; @@ -603,7 +603,7 @@ void SpecialAbilityUpdate::onExit( Bool cleanup ) TheAudio->removeAudioEvent( m_prepSoundLoop.getPlayingHandle() ); endPreparation(); - if( !data->m_specialObjectsPersistent || cleanup && !data->m_specialObjectsPersistWhenOwnerDies ) + if( !data->m_specialObjectsPersistent || (cleanup && !data->m_specialObjectsPersistWhenOwnerDies) ) { //Delete special objects that aren't considered persistent whenever we turn off //leave the special ability update. diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp index 9cdf2e39ec4..9295fc519d4 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Weapon.cpp @@ -957,7 +957,7 @@ UnsignedInt WeaponTemplate::fireWeaponTemplate Coord3D projectileDestination = *victimPos; //Need to copy this, as we have a pointer to their actual position Real scatterRadius = 0.0f; - if( m_scatterRadius > 0.0f || m_infantryInaccuracyDist > 0.0f && victimObj && victimObj->isKindOf( KINDOF_INFANTRY ) ) + if( m_scatterRadius > 0.0f || (m_infantryInaccuracyDist > 0.0f && victimObj && victimObj->isKindOf( KINDOF_INFANTRY )) ) { // This weapon scatters, so clear the victimObj, as we are no longer shooting it directly, // and find a random point within the radius to shoot at as victimPos @@ -2622,7 +2622,7 @@ Bool Weapon::privateFireWeapon( } // it's a mine, but doesn't have LandMineInterface... - if( !found && victimObj->isKindOf( KINDOF_MINE ) || victimObj->isKindOf( KINDOF_BOOBY_TRAP ) || victimObj->isKindOf( KINDOF_DEMOTRAP ) ) + if( (!found && victimObj->isKindOf( KINDOF_MINE )) || victimObj->isKindOf( KINDOF_BOOBY_TRAP ) || victimObj->isKindOf( KINDOF_DEMOTRAP ) ) { VeterancyLevel v = sourceObj->getVeterancyLevel(); FXList::doFXPos(m_template->getFireFX(v), victimObj->getPosition(), victimObj->getTransformMatrix(), 0, victimObj->getPosition(), 0); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp index 546efa1ae32..e2c9a2935c7 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptActions.cpp @@ -3395,8 +3395,7 @@ void ScriptActions::doTeamGarrisonSpecificBuilding(const AsciiString& teamName, } PlayerMaskType player = theBuilding->getContain()->getPlayerWhoEntered(); - if (!(theBuilding->isKindOf(KINDOF_STRUCTURE) && - (player == 0) || (player == theTeam->getControllingPlayer()->getPlayerMask()))) { + if (!theBuilding->isKindOf(KINDOF_STRUCTURE) || (player != 0 && player != theTeam->getControllingPlayer()->getPlayerMask())) { return; } @@ -3561,10 +3560,10 @@ void ScriptActions::doUnitGarrisonSpecificBuilding(const AsciiString& unitName, } PlayerMaskType player = theBuilding->getContain()->getPlayerWhoEntered(); - if (!(theBuilding->isKindOf(KINDOF_STRUCTURE) && - (player == 0) || (player == theUnit->getControllingPlayer()->getPlayerMask()))) { + if (!theBuilding->isKindOf(KINDOF_STRUCTURE) || (player != 0 && player != theUnit->getControllingPlayer()->getPlayerMask())) { return; } + AIUpdateInterface *ai = theUnit->getAIUpdateInterface(); if (!ai) { return; diff --git a/GeneralsMD/Code/Tools/GUIEdit/Source/HierarchyView.cpp b/GeneralsMD/Code/Tools/GUIEdit/Source/HierarchyView.cpp index f92649732dd..4dad1818a42 100644 --- a/GeneralsMD/Code/Tools/GUIEdit/Source/HierarchyView.cpp +++ b/GeneralsMD/Code/Tools/GUIEdit/Source/HierarchyView.cpp @@ -720,7 +720,7 @@ void HierarchyView::addWindowToTree( GameWindow *window, // add children if requested, but not on gadgets no matter what because // they are "atomic units", except for tab controls. // - if( addChildren && TheEditor->windowIsGadget( window ) == FALSE || (window->winGetStyle() & GWS_TAB_CONTROL) ) + if( (addChildren && TheEditor->windowIsGadget( window ) == FALSE) || (window->winGetStyle() & GWS_TAB_CONTROL) ) { GameWindow *child; From aad60ee953dd2f835c00bc5fd928c91cf1405c63 Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Sun, 18 Jan 2026 15:57:56 +0100 Subject: [PATCH 2/2] Fixed warnings - with logic change. --- .../GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp | 2 +- .../Code/GameEngine/Source/GameClient/Input/Keyboard.cpp | 2 +- .../Source/GameLogic/ScriptEngine/ScriptEngine.cpp | 6 +++--- .../GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp | 2 +- .../Code/GameEngine/Source/GameClient/Input/Keyboard.cpp | 2 +- .../Source/GameLogic/ScriptEngine/ScriptEngine.cpp | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index 18176013d0d..41a280cef98 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -985,7 +985,7 @@ static void setDefaults( void ) //------------------------------------------------------------------------------------------------- // Resolution //Find index of 800x600 mode. - if ((TheGameLogic->isInGame() == FALSE) || (TheGameLogic->isInShellGame() == TRUE) && !TheGameSpyInfo) { + if ((TheGameLogic->isInGame() == FALSE || TheGameLogic->isInShellGame() == TRUE) && !TheGameSpyInfo) { Int numResolutions = TheDisplay->getDisplayModeCount(); Int defaultResIndex=0; for( Int i = 0; i < numResolutions; ++i ) diff --git a/Generals/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp b/Generals/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp index 6ad9ad18111..5c0f150da28 100644 --- a/Generals/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp @@ -961,7 +961,7 @@ WideChar Keyboard::translateKey( WideChar keyCode ) return( m_keyNames[ ubKeyCode ].shifted2 ); } - if( isShift() || getCapsState() && iswalpha( m_keyNames[ ubKeyCode ].stdKey ) ) + if( isShift() || ( getCapsState() && iswalpha( m_keyNames[ ubKeyCode ].stdKey ) ) ) { return( m_keyNames[ ubKeyCode ].shifted ); } diff --git a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp index 72d63deea2c..e635dffce06 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp @@ -7213,9 +7213,9 @@ void ScriptEngine::evaluateAndProgressAllSequentialScripts( void ) #endif } - if( ai || aigroup ) { - if (((ai && (ai->isIdle()) || (aigroup && aigroup->isIdle())) && - seqScript->m_framesToWait < 1) || (seqScript->m_framesToWait == 0)) { + if (ai || aigroup) { + if (seqScript->m_framesToWait == 0 || + (seqScript->m_framesToWait < 0 && ((ai && ai->isIdle()) || (aigroup && aigroup->isIdle())))) { // We want to supress messages if we're repeatedly waiting for an event to occur, cause // it KILLS our debug framerate. diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index 80e69828fe7..45d096faf4a 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -1029,7 +1029,7 @@ static void setDefaults( void ) //------------------------------------------------------------------------------------------------- // Resolution //Find index of 800x600 mode. - if ((TheGameLogic->isInGame() == FALSE) || (TheGameLogic->isInShellGame() == TRUE) && !TheGameSpyInfo) { + if ((TheGameLogic->isInGame() == FALSE || TheGameLogic->isInShellGame() == TRUE) && !TheGameSpyInfo) { Int numResolutions = TheDisplay->getDisplayModeCount(); Int defaultResIndex=0; for( Int i = 0; i < numResolutions; ++i ) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp index 25c358d358d..a4e087fb752 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/Input/Keyboard.cpp @@ -959,7 +959,7 @@ WideChar Keyboard::translateKey( WideChar keyCode ) return( m_keyNames[ ubKeyCode ].shifted2 ); } - if( isShift() || getCapsState() && iswalpha( m_keyNames[ ubKeyCode ].stdKey ) ) + if( isShift() || ( getCapsState() && iswalpha( m_keyNames[ ubKeyCode ].stdKey ) ) ) { return( m_keyNames[ ubKeyCode ].shifted ); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp index b9702235210..78967d14ad6 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/ScriptEngine/ScriptEngine.cpp @@ -7936,9 +7936,9 @@ void ScriptEngine::evaluateAndProgressAllSequentialScripts( void ) #endif } - if( ai || aigroup ) { - if (((ai && (ai->isIdle()) || (aigroup && aigroup->isIdle())) && - seqScript->m_framesToWait < 1) || (seqScript->m_framesToWait == 0)) { + if (ai || aigroup) { + if (seqScript->m_framesToWait == 0 || + (seqScript->m_framesToWait < 0 && ((ai && ai->isIdle()) || (aigroup && aigroup->isIdle())))) { // We want to supress messages if we're repeatedly waiting for an event to occur, cause // it KILLS our debug framerate.