Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions Core/GameEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(GAMEENGINE_SRC
Include/Common/AcademyStats.h
# Include/Common/ActionManager.h
Include/Common/ActionManager.h
Include/Common/AddonCompat.h
Include/Common/ArchiveFile.h
Include/Common/ArchiveFileSystem.h
Expand Down Expand Up @@ -37,7 +37,7 @@ set(GAMEENGINE_SRC
# Include/Common/DrawModule.h
Include/Common/DynamicAudioEventInfo.h
# Include/Common/encrypt.h
# Include/Common/Energy.h
Include/Common/Energy.h
Include/Common/Errors.h
Include/Common/file.h
Include/Common/FileSystem.h
Expand All @@ -60,7 +60,7 @@ set(GAMEENGINE_SRC
Include/Common/GameUtility.h
# Include/Common/Geometry.h
# Include/Common/GlobalData.h
# Include/Common/Handicap.h
Include/Common/Handicap.h
# Include/Common/IgnorePreferences.h
Include/Common/INI.h
# Include/Common/INIException.h
Expand All @@ -76,11 +76,11 @@ set(GAMEENGINE_SRC
Include/Common/MessageStream.h
Include/Common/MiniLog.h
Include/Common/MiscAudio.h
# Include/Common/MissionStats.h
Include/Common/MissionStats.h
# Include/Common/ModelState.h
# Include/Common/Module.h
# Include/Common/ModuleFactory.h
# Include/Common/Money.h
Include/Common/Money.h
# Include/Common/MultiplayerSettings.h
# Include/Common/NameKeyGenerator.h
Include/Common/ObjectStatusTypes.h
Expand All @@ -91,10 +91,10 @@ set(GAMEENGINE_SRC
# Include/Common/PartitionSolver.h
# Include/Common/PerfMetrics.h
Include/Common/PerfTimer.h
# Include/Common/Player.h
# Include/Common/PlayerList.h
# Include/Common/PlayerTemplate.h
# Include/Common/ProductionPrerequisite.h
Include/Common/Player.h
Include/Common/PlayerList.h
Include/Common/PlayerTemplate.h
Include/Common/ProductionPrerequisite.h
# Include/Common/QuickmatchPreferences.h
# Include/Common/QuotedPrintable.h
Include/Common/Radar.h
Expand All @@ -103,32 +103,32 @@ set(GAMEENGINE_SRC
# Include/Common/Recorder.h
# Include/Common/Registry.h
Include/Common/ReplaySimulation.h
# Include/Common/ResourceGatheringManager.h
# Include/Common/Science.h
Include/Common/ResourceGatheringManager.h
Include/Common/Science.h
# Include/Common/ScopedMutex.h
# Include/Common/ScoreKeeper.h
Include/Common/ScoreKeeper.h
#Include/Common/simpleplayer.h # unused
# Include/Common/SkirmishBattleHonors.h
# Include/Common/SkirmishPreferences.h
Include/Common/Snapshot.h
# Include/Common/SparseMatchFinder.h
# Include/Common/SpecialPower.h
# Include/Common/SpecialPowerMaskType.h
# Include/Common/SpecialPowerType.h
Include/Common/SpecialPower.h
Include/Common/SpecialPowerMaskType.h
Include/Common/SpecialPowerType.h
# Include/Common/StackDump.h
# Include/Common/StateMachine.h
# Include/Common/StatsCollector.h
Include/Common/STLTypedefs.h
Include/Common/StreamingArchiveFile.h
Include/Common/SubsystemInterface.h
# Include/Common/Team.h
Include/Common/Team.h
# Include/Common/Terrain.h
Include/Common/TerrainTypes.h
# Include/Common/Thing.h
# Include/Common/ThingFactory.h
# Include/Common/ThingSort.h
Include/Common/ThingTemplate.h
# Include/Common/TunnelTracker.h
Include/Common/TunnelTracker.h
Include/Common/UnicodeString.h
# Include/Common/UnitTimings.h
# Include/Common/Upgrade.h
Expand Down Expand Up @@ -633,21 +633,21 @@ set(GAMEENGINE_SRC
# Source/Common/Recorder.cpp
Source/Common/ReplaySimulation.cpp
Source/Common/RTS/AcademyStats.cpp
# Source/Common/RTS/ActionManager.cpp
# Source/Common/RTS/Energy.cpp
# Source/Common/RTS/Handicap.cpp
# Source/Common/RTS/MissionStats.cpp
# Source/Common/RTS/Money.cpp
# Source/Common/RTS/Player.cpp
# Source/Common/RTS/PlayerList.cpp
# Source/Common/RTS/PlayerTemplate.cpp
# Source/Common/RTS/ProductionPrerequisite.cpp
# Source/Common/RTS/ResourceGatheringManager.cpp
# Source/Common/RTS/Science.cpp
# Source/Common/RTS/ScoreKeeper.cpp
# Source/Common/RTS/SpecialPower.cpp
# Source/Common/RTS/Team.cpp
# Source/Common/RTS/TunnelTracker.cpp
Source/Common/RTS/ActionManager.cpp
Source/Common/RTS/Energy.cpp
Source/Common/RTS/Handicap.cpp
Source/Common/RTS/MissionStats.cpp
Source/Common/RTS/Money.cpp
Source/Common/RTS/Player.cpp
Source/Common/RTS/PlayerList.cpp
Source/Common/RTS/PlayerTemplate.cpp
Source/Common/RTS/ProductionPrerequisite.cpp
Source/Common/RTS/ResourceGatheringManager.cpp
Source/Common/RTS/Science.cpp
Source/Common/RTS/ScoreKeeper.cpp
Source/Common/RTS/SpecialPower.cpp
Source/Common/RTS/Team.cpp
Source/Common/RTS/TunnelTracker.cpp
# Source/Common/SkirmishBattleHonors.cpp
# Source/Common/StateMachine.cpp
# Source/Common/StatsCollector.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,14 @@ class Player : public Snapshot
Bool getUnitsShouldHunt() const { return m_unitsShouldHunt; }

/// All of our units are new spied upon; they sight for the given enemy
#if RTS_GENERALS
void setUnitsVisionSpied( Bool setting, PlayerIndex byWhom );

/// This will be asked by units when they look to get extra people to sight for
PlayerMaskType getVisionSpiedMask() const;
#else
void setUnitsVisionSpied( Bool setting, KindOfMaskType whichUnits, PlayerIndex byWhom );
#endif

/// Destroy all of the teams for this player, causing him to DIE.
void killPlayer();
Expand Down Expand Up @@ -800,6 +807,10 @@ class Player : public Snapshot

Bool m_attackedBy[MAX_PLAYER_COUNT]; ///< For each player, have they attacked me?
UnsignedInt m_attackedFrame; ///< Last frame attacked.
#if RTS_GENERALS
Int m_visionSpiedBy[MAX_PLAYER_COUNT]; ///< Reference count of having units spied on by players.
PlayerMaskType m_visionSpiedMask; ///< For quick lookup and edge triggered maintenance
#endif

Real m_cashBountyPercent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ enum SpecialPowerType CPP_11(: Int)
SPECIAL_MISSILE_DEFENDER_LASER_GUIDED_MISSILES,
SPECIAL_REMOTE_CHARGES,
SPECIAL_TIMED_CHARGES,
SPECIAL_HELIX_NAPALM_BOMB,
SPECIAL_HELIX_NAPALM_BOMB, // Added in Zero Hour
SPECIAL_HACKER_DISABLE_BUILDING,
SPECIAL_TANKHUNTER_TNT_ATTACK,
SPECIAL_BLACKLOTUS_CAPTURE_BUILDING,
Expand All @@ -81,7 +81,7 @@ enum SpecialPowerType CPP_11(: Int)
SPECIAL_RADAR_VAN_SCAN,
SPECIAL_SPY_DRONE,
SPECIAL_DISGUISE_AS_VEHICLE,
SPECIAL_BOOBY_TRAP,
SPECIAL_BOOBY_TRAP, // Added in Zero Hour
// don't forget to add new strings to SpecialPowerMaskType::s_bitNameList[]
SPECIAL_REPAIR_VEHICLES,
SPECIAL_PARTICLE_UPLINK_CANNON,
Expand All @@ -92,6 +92,7 @@ enum SpecialPowerType CPP_11(: Int)
// don't forget to add new strings to SpecialPowerMaskType::s_bitNameList[]
SPECIAL_LAUNCH_BAIKONUR_ROCKET,

// TheSuperHackers @info Added in Zero Hour:
SPECIAL_SPECTRE_GUNSHIP,
SPECIAL_GPS_SCRAMBLER,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,11 @@ Bool ActionManager::canGetRepairedAt( const Object *obj, const Object *repairDes
if( obj->isEffectivelyDead() )
return FALSE;

#if !(RTS_GENERALS && RETAIL_COMPATIBLE_CRC)
// If I can't move, I can't get repaired
if( !obj->isMobile() )
return FALSE;
#endif

// nothing can be done with things that are under construction
if( obj->getStatusBits().test( OBJECT_STATUS_UNDER_CONSTRUCTION ) ||
Expand Down Expand Up @@ -745,6 +747,7 @@ CanAttackResult ActionManager::getCanAttackObject( const Object *obj, const Obje
CanAttackResult result = obj->getAbleToAttackSpecificObject( attackType, objectToAttack, commandSource );
if( result != ATTACKRESULT_NOT_POSSIBLE )
{
#if !(RTS_GENERALS && RETAIL_COMPATIBLE_CRC)
Comment thread
Jaredl-Dev marked this conversation as resolved.
Resolved
//Kris: August 5, 2003
//Fix a case where the Demo_GLAInfantryWorker is able to attack using his passive bomb upgrade. We don't
//want him to allow a visible attack cursor for the player. This code never checked for AutoChoosesSources
Expand All @@ -767,6 +770,7 @@ CanAttackResult ActionManager::getCanAttackObject( const Object *obj, const Obje
return ATTACKRESULT_NOT_POSSIBLE;
}
}
#endif

if( result == ATTACKRESULT_INVALID_SHOT && obj->isKindOf( KINDOF_DOZER ) )
{
Expand Down Expand Up @@ -1076,8 +1080,11 @@ Bool ActionManager::canCaptureBuilding( const Object *obj, const Object *objectT

//If the enemy unit is stealthed and not detected, then we can't capture it!
if( objectToCapture->testStatus( OBJECT_STATUS_STEALTHED ) &&
!objectToCapture->testStatus( OBJECT_STATUS_DETECTED ) &&
!objectToCapture->testStatus( OBJECT_STATUS_DISGUISED ) )
!objectToCapture->testStatus( OBJECT_STATUS_DETECTED )
#if !(RTS_GENERALS && RETAIL_COMPATIBLE_CRC)
&& !objectToCapture->testStatus( OBJECT_STATUS_DISGUISED )
#endif
)
{
return FALSE;
}
Expand Down Expand Up @@ -1166,8 +1173,11 @@ Bool ActionManager::canDisableVehicleViaHacking( const Object *obj, const Object

//If the enemy unit is stealthed and not detected, then we can't attack it!
if( objectToHack->testStatus( OBJECT_STATUS_STEALTHED ) &&
!objectToHack->testStatus( OBJECT_STATUS_DETECTED ) &&
!objectToHack->testStatus( OBJECT_STATUS_DISGUISED ) )
!objectToHack->testStatus( OBJECT_STATUS_DETECTED )
#if !(RTS_GENERALS && RETAIL_COMPATIBLE_CRC)
&& !objectToHack->testStatus( OBJECT_STATUS_DISGUISED )
#endif
)
{
return FALSE;
}
Expand Down Expand Up @@ -1296,8 +1306,11 @@ Bool ActionManager::canStealCashViaHacking( const Object *obj, const Object *obj

//If the enemy unit is stealthed and not detected, then we can't attack it!
if( objectToHack->testStatus( OBJECT_STATUS_STEALTHED ) &&
!objectToHack->testStatus( OBJECT_STATUS_DETECTED ) &&
!objectToHack->testStatus( OBJECT_STATUS_DISGUISED ) )
!objectToHack->testStatus( OBJECT_STATUS_DETECTED )
#if !(RTS_GENERALS && RETAIL_COMPATIBLE_CRC)
&& !objectToHack->testStatus( OBJECT_STATUS_DISGUISED )
#endif
)
{
return FALSE;
}
Expand Down Expand Up @@ -1369,8 +1382,11 @@ Bool ActionManager::canDisableBuildingViaHacking( const Object *obj, const Objec

//If the enemy unit is stealthed and not detected, then we can't attack it!
if( objectToHack->testStatus( OBJECT_STATUS_STEALTHED ) &&
!objectToHack->testStatus( OBJECT_STATUS_DETECTED ) &&
!objectToHack->testStatus( OBJECT_STATUS_DISGUISED ) )
!objectToHack->testStatus( OBJECT_STATUS_DETECTED )
#if !(RTS_GENERALS && RETAIL_COMPATIBLE_CRC)
&& !objectToHack->testStatus( OBJECT_STATUS_DISGUISED )
#endif
)
{
return FALSE;
}
Expand Down Expand Up @@ -1561,9 +1577,13 @@ Bool ActionManager::canDoSpecialPowerAtLocation( const Object *obj, const Coord3
case SPECIAL_RADAR_VAN_SCAN:
case SPECIAL_SPY_DRONE:
case SPECIAL_HELIX_NAPALM_BOMB:

#if RTS_GENERALS && RETAIL_COMPATIBLE_CRC
//These specials can be used anywhere!
return TRUE;
#else
//These specials can be used anywhere!
return isPointOnMap( loc );
#endif
case SPECIAL_LAUNCH_BAIKONUR_ROCKET:
return TRUE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,19 @@ void Energy::crc( Xfer *xfer )
// ------------------------------------------------------------------------------------------------
/** Xfer method
* Version Info:
* 1: Initial version */
* 1: Initial version
* 2: Stop saving production and consumption
* 3: Added m_powerSabotagedTillFrame (Added in Zero Hour) */
// ------------------------------------------------------------------------------------------------
void Energy::xfer( Xfer *xfer )
{

// version
#if RTS_GENERALS && RETAIL_COMPATIBLE_XFER_SAVE
XferVersion currentVersion = 2;
#else
XferVersion currentVersion = 3;
#endif
XferVersion version = currentVersion;
xfer->xferVersion( &version, currentVersion );

Expand Down
Loading
Loading