Zero Hour rebuilt from EA's source: x64, Direct3D 11, VS2022/CMake, ~60 original bugs fixed, an AI that builds a base. Bring your own game.
C++ cmakecnccommand-and-conquercppdirectx11game-enginegame-preservationgeneralsrtssage-enginex64zero-hour
fix(gameengine): hackers lead no rank aura and draw no ring
Olcay Seygan33b1d581624a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 97a2b3d7d..f15933881 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -16,6 +16,7 @@ found and fixed, EA's own, not port damage.**- Red Guard Training lifts a new Red Guard three grades, to Corporal, where it used to make him a Veteran Sergeant with the horde bonus from his first second. Every other unit that came off the line a level up now comes three grades up for EA's Veteran and six for its Elite: Technicals and Inferno and Nuke Cannons with their trainings, a Battlemaster with Battlemaster Training on grade 6, and the Tank General's tanks and the Infantry General's infantry, who start three grades up. Two on one unit add up, so the Tank General's trained Battlemaster starts on grade 9 and the Infantry General's Mini-Gunner with Mini-Gunner Training on grade 6, both still Veteran where EA made them Elite.- An American Second Lieutenant (grade 18) gives every friendly unit within 140 of it +12% rate of fire; a Captain two grades later heals them 1% of their health a second. A GLA Field Commander (grade 13) heals 1% a second at a radius of 140, and a Warlord (grade 15) speeds up every unit near it by 12%.- Every aura a ranked leader gives draws its own ring on the ground, out at that aura's radius, so you can see which units each one covers. The rings are always there, nothing to select, under your leaders and the enemy's alike, and an enemy leader hidden in the fog, or stealthed and not detected, shows no ring. The rings borrow Turkiye's five patterns and tell the kinds apart by tint where two share a pattern. Detection draws none.+- Hackers give no aura and draw no ring, whatever their rank. A hacker climbs on its hacking payouts alone, so a row of them at the back of a Chinese base reached Second Lieutenant and up and laid a stack of officer's rings over the whole base without ever leading anyone into a fight. Their own rank bonuses stay.- The full tables, grade by grade, are on the Rank ladder page of the website.## Frenchdiff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/Object.hindex 0c449ea7a..5e0164162 100644--- a/GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h+++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h@@ -307,6 +307,7 @@ public:Real getRankSightScalar() const; ///< my own sight perk times the sight aura on meReal getRankDamageTakenScalar() const; ///< guard, rally and the still guard perk, multipliedBool isSpotter() const; ///< SpotterSight on the template, or the SPOTTER perk+ Bool leadsRankAuras() const; ///< FALSE for a hacker: its grade's AURA_ lines give nothingvoid onRankSightChanged( Real oldScalar ); ///< look again if the rank sight movedvoid giveRankRally(); ///< I fell: my death rally reaches the allies around mevoid dropRankSalvage(); ///< I fell: my SALVAGE_CRATE perk leaves a crate where I laydiff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cppindex a1499d988..cc941f27c 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/ControlBar/ControlBar.cpp@@ -174,7 +174,7 @@ static void portraitRankTooltip( GameWindow *window, WinInstanceData *instData,for( Int perk = 0; perk < RANK_PERK_COUNT; ++perk ){Real value = ladder->perk( grade, (RankPerk)perk );- if( value <= 0.0f )+ if( value <= 0.0f || ( ( perk == RANK_PERK_AURA_RADIUS || perk >= RANK_PERK_AURA_RATE_OF_FIRE ) && !obj->leadsRankAuras() ) )continue;if( perk == RANK_PERK_SIGHT || perk == RANK_PERK_AURA_RADIUS )value -= 1.0f;diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cppindex 311ee85e0..8664f1c1c 100644--- a/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameClient/InGameUI.cpp@@ -1522,7 +1522,7 @@ Bool InGameUI::isTimeFrozenWithoutTick( void ) conststatic Int ringedAuraKinds( const Object *obj, Int kinds[ RANK_AURA_COUNT ] ){const RankLadder *ladder = TheGlobalData->getRankLadder( obj->getTemplate() );- if( ladder == NULL )+ if( ladder == NULL || !obj->leadsRankAuras() )return 0;const Int grade = obj->getRankGrade();Int count = 0;diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cppindex 8bf1c15d8..8b5fb0ae1 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp@@ -5646,6 +5646,15 @@ Bool Object::isSpotter() constreturn getTemplate()->hasSpotterSight() || getRankPerk( RANK_PERK_SPOTTER ) > 0.0f;}+//-------------------------------------------------------------------------------------------------+/** A hacker climbs the ladder on its payouts alone and sits at the back keyboarding, so it leads+ * nobody: no aura, no ring, whatever its grade. */+//-------------------------------------------------------------------------------------------------+Bool Object::leadsRankAuras() const+{+ return !( m_ai && m_ai->getHackInternetAIInterface() );+}+//-------------------------------------------------------------------------------------------------void Object::onRankSightChanged( Real oldScalar ){diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cppindex a2bbc6cf4..1f0d01bf0 100644--- a/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp+++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/System/GameLogic.cpp@@ -4106,6 +4106,7 @@ static void updateRankAuras( Object *objList )reach[ aura ] = ladder->auraReach( grade, (RankAura)aura );gives = gives || strength[ aura ] > 0.0f;}+ gives = gives && leader->leadsRankAuras();const Real detect = ladder->perk( grade, RANK_PERK_DETECT );if( !gives && detect <= 0.0f )continue;