From 33377a7f70d58da0386e91fde84f08ce3016c9a9 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Thu, 29 May 2025 19:58:24 +0200 Subject: [PATCH 1/3] [GEN][ZH] Decouple the Game Logic update in ParticleUplinkCannonUpdate from the Orbit To Ground Laser drawable --- .../Code/GameEngine/Include/Common/Debug.h | 11 +++ .../Update/ParticleUplinkCannonUpdate.cpp | 96 +++++++++++-------- .../Code/GameEngine/Include/Common/Debug.h | 11 +++ .../Update/ParticleUplinkCannonUpdate.cpp | 96 +++++++++++-------- 4 files changed, 130 insertions(+), 84 deletions(-) diff --git a/Generals/Code/GameEngine/Include/Common/Debug.h b/Generals/Code/GameEngine/Include/Common/Debug.h index 829946295e0..ec486237e1a 100644 --- a/Generals/Code/GameEngine/Include/Common/Debug.h +++ b/Generals/Code/GameEngine/Include/Common/Debug.h @@ -48,6 +48,8 @@ #ifndef __DEBUG_H_ #define __DEBUG_H_ +#include "Common/GameDefines.h" + class AsciiString; #if defined(RTS_DEBUG) && defined(RTS_INTERNAL) @@ -213,6 +215,15 @@ class AsciiString; #endif +#if defined(RETAIL_COMPATIBLE_CRC) + #define DEBUG_CRASH_RETAIL_COMPATIBLE_CRC(c, m) DEBUG_CRASH(m) + #define DEBUG_ASSERTCRASH_RETAIL_COMPATIBLE_CRC(c, m) DEBUG_ASSERTCRASH(c, m) +#else + #define DEBUG_CRASH_RETAIL_COMPATIBLE_CRC(c, m) ((void)0) + #define DEBUG_ASSERTCRASH_RETAIL_COMPATIBLE_CRC(c, m) ((void)0) +#endif + + DEBUG_EXTERN_C void ReleaseCrash(const char* reason); DEBUG_EXTERN_C void ReleaseCrashLocalized(const AsciiString& p, const AsciiString& m); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp index b3c2038a9e5..d67521066fa 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp @@ -211,7 +211,7 @@ void ParticleUplinkCannonUpdate::killEverything() removeAllEffects(); //This laser is independent from the other effects and needs to be specially handled. - if( m_orbitToTargetBeamID ) + if( m_orbitToTargetBeamID != INVALID_DRAWABLE_ID ) { Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); if( beam ) @@ -219,8 +219,8 @@ void ParticleUplinkCannonUpdate::killEverything() TheGameClient->destroyDrawable( beam ); } m_orbitToTargetBeamID = INVALID_DRAWABLE_ID; - m_orbitToTargetLaserRadius = LaserRadiusUpdate(); } + m_orbitToTargetLaserRadius = LaserRadiusUpdate(); TheAudio->removeAudioEvent( m_powerupSound.getPlayingHandle() ); TheAudio->removeAudioEvent( m_unpackToReadySound.getPlayingHandle() ); @@ -410,40 +410,43 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update() break; case LASERSTATUS_BORN: { - Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); - if( beam ) + if( orbitalDecayStart <= now ) { - //m_annihilationSound.setPosition( beam->getPosition() ); - if( orbitalDecayStart <= now ) + Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); + if( beam ) { + //m_annihilationSound.setPosition( beam->getPosition() ); static NameKeyType nameKeyClientUpdate = NAMEKEY( "LaserUpdate" ); LaserUpdate *update = (LaserUpdate*)beam->findClientUpdateModule( nameKeyClientUpdate ); if( update ) { update->setDecayFrames( data->m_widthGrowFrames ); - m_orbitToTargetLaserRadius.setDecayFrames( data->m_widthGrowFrames ); } - m_laserStatus = LASERSTATUS_DECAYING; } + m_orbitToTargetLaserRadius.setDecayFrames( data->m_widthGrowFrames ); + m_laserStatus = LASERSTATUS_DECAYING; } break; } case LASERSTATUS_DECAYING: { - Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); - if( beam ) + if( orbitalDeathFrame <= now ) { - //m_annihilationSound.setPosition( beam->getPosition() ); TheAudio->removeAudioEvent( m_annihilationSound.getPlayingHandle() ); - if( orbitalDeathFrame <= now ) + if ( m_orbitToTargetBeamID != INVALID_DRAWABLE_ID ) { - TheGameClient->destroyDrawable( beam ); + Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); + if( beam ) + { + //m_annihilationSound.setPosition( beam->getPosition() ); + TheGameClient->destroyDrawable( beam ); + } m_orbitToTargetBeamID = INVALID_DRAWABLE_ID; - m_orbitToTargetLaserRadius = LaserRadiusUpdate(); - m_laserStatus = LASERSTATUS_DEAD; - m_startAttackFrame = 0; - setLogicalStatus( STATUS_IDLE ); } + m_orbitToTargetLaserRadius = LaserRadiusUpdate(); + m_laserStatus = LASERSTATUS_DEAD; + m_startAttackFrame = 0; + setLogicalStatus( STATUS_IDLE ); } break; } @@ -452,8 +455,7 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update() break; } - Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); - if( beam && orbitalBirthFrame <= now && now <= orbitalDeathFrame ) + if( orbitalBirthFrame <= now && now < orbitalDeathFrame ) { if( !m_manualTargetMode ) @@ -548,27 +550,33 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update() Real scorchRadius = 0.0f; Real damageRadius = 0.0f; + Real templateLaserRadius = 13.0f; + Real visualLaserRadius = 0.0f; //Reset the laser position - static NameKeyType nameKeyClientUpdate = NAMEKEY( "LaserUpdate" ); - LaserUpdate *update = (LaserUpdate*)beam->findClientUpdateModule( nameKeyClientUpdate ); - if( update ) + Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); + if ( beam ) { - update->initLaser( NULL, &orbitPosition, &m_currentTargetPosition ); - const Real visualLaserRadius = update->getCurrentLaserRadius(); - scorchRadius = visualLaserRadius * data->m_scorchMarkScalar; - - // TheSuperHackers @refactor helmutbuhler/xezon 17/05/2025 - // Originally the damage radius was calculated with a value updated by LaserUpdate::clientUpdate(). - // To no longer rely on client updates, this class now maintains a logical copy of the visual laser radius. - m_orbitToTargetLaserRadius.updateRadius(); - const Real logicalLaserRadius = update->getTemplateLaserRadius() * m_orbitToTargetLaserRadius.getWidthScale(); - damageRadius = logicalLaserRadius * data->m_damageRadiusScalar; -#if RETAIL_COMPATIBLE_CRC - DEBUG_ASSERTCRASH(logicalLaserRadius == visualLaserRadius, - ("ParticleUplinkCannonUpdate's laser radius does not match LaserUpdate's laser radius - will cause mismatch in VS6 retail compatible builds\n")); -#endif + static NameKeyType nameKeyClientUpdate = NAMEKEY( "LaserUpdate" ); + LaserUpdate *update = (LaserUpdate*)beam->findClientUpdateModule( nameKeyClientUpdate ); + if( update ) + { + update->initLaser( NULL, &orbitPosition, &m_currentTargetPosition ); + // TheSuperHackers @info The GameLogic has a dependency on this drawable. + // @todo The logical laser radius for the damage should probably be part of ParticleUplinkCannonUpdateModuleData. + templateLaserRadius = update->getTemplateLaserRadius(); + visualLaserRadius = update->getCurrentLaserRadius(); + } } + // TheSuperHackers @refactor helmutbuhler/xezon 17/05/2025 + // Originally the damageRadius was calculated with a value updated by LaserUpdate::clientUpdate. + // To no longer rely on GameClient updates, this class now maintains a copy of the LaserRadiusUpdate. + m_orbitToTargetLaserRadius.updateRadius(); + const Real logicalLaserRadius = templateLaserRadius * m_orbitToTargetLaserRadius.getWidthScale(); + damageRadius = logicalLaserRadius * data->m_damageRadiusScalar; + scorchRadius = logicalLaserRadius * data->m_scorchMarkScalar; + DEBUG_ASSERTCRASH_RETAIL_COMPATIBLE_CRC(logicalLaserRadius == visualLaserRadius, + ("ParticleUplinkCannonUpdate's laser radius does not match LaserUpdate's laser radius - will cause mismatch in VS6 retail compatible builds\n")); //Create scorch marks periodically if( m_nextScorchMarkFrame <= now ) @@ -917,13 +925,15 @@ void ParticleUplinkCannonUpdate::createOrbitToTargetLaser( UnsignedInt growthFra { const ParticleUplinkCannonUpdateModuleData *data = getParticleUplinkCannonUpdateModuleData(); - Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); - if( beam ) + if ( m_orbitToTargetBeamID != INVALID_DRAWABLE_ID ) { - TheAudio->removeAudioEvent( m_annihilationSound.getPlayingHandle() ); - TheGameClient->destroyDrawable( beam ); + Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); + if( beam ) + { + TheAudio->removeAudioEvent( m_annihilationSound.getPlayingHandle() ); + TheGameClient->destroyDrawable( beam ); + } m_orbitToTargetBeamID = INVALID_DRAWABLE_ID; - m_orbitToTargetLaserRadius = LaserRadiusUpdate(); } if( data->m_particleBeamLaserName.isNotEmpty() ) @@ -943,7 +953,6 @@ void ParticleUplinkCannonUpdate::createOrbitToTargetLaser( UnsignedInt growthFra orbitPosition.set( &m_initialTargetPosition ); orbitPosition.z += 500.0f; update->initLaser( NULL, &orbitPosition, &m_initialTargetPosition, growthFrames ); - m_orbitToTargetLaserRadius.initRadius( growthFrames ); } } } @@ -954,6 +963,9 @@ void ParticleUplinkCannonUpdate::createOrbitToTargetLaser( UnsignedInt growthFra m_annihilationSound.setPlayingHandle( TheAudio->addAudioEvent( &m_annihilationSound ) ); } } + + m_orbitToTargetLaserRadius = LaserRadiusUpdate(); + m_orbitToTargetLaserRadius.initRadius( growthFrames ); } //------------------------------------------------------------------------------------------------- diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Debug.h b/GeneralsMD/Code/GameEngine/Include/Common/Debug.h index fe873feeaf6..ddf85bac65a 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/Debug.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/Debug.h @@ -48,6 +48,8 @@ #ifndef __DEBUG_H_ #define __DEBUG_H_ +#include "Common/GameDefines.h" + class AsciiString; #if defined(RTS_DEBUG) && defined(RTS_INTERNAL) @@ -219,6 +221,15 @@ class AsciiString; #endif +#if defined(RETAIL_COMPATIBLE_CRC) + #define DEBUG_CRASH_RETAIL_COMPATIBLE_CRC(c, m) DEBUG_CRASH(m) + #define DEBUG_ASSERTCRASH_RETAIL_COMPATIBLE_CRC(c, m) DEBUG_ASSERTCRASH(c, m) +#else + #define DEBUG_CRASH_RETAIL_COMPATIBLE_CRC(c, m) ((void)0) + #define DEBUG_ASSERTCRASH_RETAIL_COMPATIBLE_CRC(c, m) ((void)0) +#endif + + DEBUG_EXTERN_C void ReleaseCrash(const char* reason); DEBUG_EXTERN_C void ReleaseCrashLocalized(const AsciiString& p, const AsciiString& m); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp index bbe396864d3..68960c2a497 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp @@ -212,7 +212,7 @@ void ParticleUplinkCannonUpdate::killEverything() removeAllEffects(); //This laser is independent from the other effects and needs to be specially handled. - if( m_orbitToTargetBeamID ) + if( m_orbitToTargetBeamID != INVALID_DRAWABLE_ID ) { Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); if( beam ) @@ -220,8 +220,8 @@ void ParticleUplinkCannonUpdate::killEverything() TheGameClient->destroyDrawable( beam ); } m_orbitToTargetBeamID = INVALID_DRAWABLE_ID; - m_orbitToTargetLaserRadius = LaserRadiusUpdate(); } + m_orbitToTargetLaserRadius = LaserRadiusUpdate(); TheAudio->removeAudioEvent( m_powerupSound.getPlayingHandle() ); TheAudio->removeAudioEvent( m_unpackToReadySound.getPlayingHandle() ); @@ -457,40 +457,43 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update() break; case LASERSTATUS_BORN: { - Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); - if( beam ) + if( orbitalDecayStart <= now ) { - //m_annihilationSound.setPosition( beam->getPosition() ); - if( orbitalDecayStart <= now ) + Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); + if( beam ) { + //m_annihilationSound.setPosition( beam->getPosition() ); static NameKeyType nameKeyClientUpdate = NAMEKEY( "LaserUpdate" ); LaserUpdate *update = (LaserUpdate*)beam->findClientUpdateModule( nameKeyClientUpdate ); if( update ) { update->setDecayFrames( data->m_widthGrowFrames ); - m_orbitToTargetLaserRadius.setDecayFrames( data->m_widthGrowFrames ); } - m_laserStatus = LASERSTATUS_DECAYING; } + m_orbitToTargetLaserRadius.setDecayFrames( data->m_widthGrowFrames ); + m_laserStatus = LASERSTATUS_DECAYING; } break; } case LASERSTATUS_DECAYING: { - Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); - if( beam ) + if( orbitalDeathFrame <= now ) { - //m_annihilationSound.setPosition( beam->getPosition() ); TheAudio->removeAudioEvent( m_annihilationSound.getPlayingHandle() ); - if( orbitalDeathFrame <= now ) + if ( m_orbitToTargetBeamID != INVALID_DRAWABLE_ID ) { - TheGameClient->destroyDrawable( beam ); + Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); + if( beam ) + { + //m_annihilationSound.setPosition( beam->getPosition() ); + TheGameClient->destroyDrawable( beam ); + } m_orbitToTargetBeamID = INVALID_DRAWABLE_ID; - m_orbitToTargetLaserRadius = LaserRadiusUpdate(); - m_laserStatus = LASERSTATUS_DEAD; - m_startAttackFrame = 0; - setLogicalStatus( STATUS_IDLE ); } + m_orbitToTargetLaserRadius = LaserRadiusUpdate(); + m_laserStatus = LASERSTATUS_DEAD; + m_startAttackFrame = 0; + setLogicalStatus( STATUS_IDLE ); } break; } @@ -499,8 +502,7 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update() break; } - Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); - if( beam && orbitalBirthFrame <= now && now <= orbitalDeathFrame ) + if( orbitalBirthFrame <= now && now < orbitalDeathFrame ) { if( !m_manualTargetMode && !m_scriptedWaypointMode ) @@ -609,27 +611,33 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update() Real scorchRadius = 0.0f; Real damageRadius = 0.0f; + Real templateLaserRadius = 13.0f; + Real visualLaserRadius = 0.0f; //Reset the laser position - static NameKeyType nameKeyClientUpdate = NAMEKEY( "LaserUpdate" ); - LaserUpdate *update = (LaserUpdate*)beam->findClientUpdateModule( nameKeyClientUpdate ); - if( update ) + Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); + if ( beam ) { - update->initLaser( NULL, NULL, &orbitPosition, &m_currentTargetPosition, "" ); - const Real visualLaserRadius = update->getCurrentLaserRadius(); - scorchRadius = visualLaserRadius * data->m_scorchMarkScalar; - - // TheSuperHackers @refactor helmutbuhler/xezon 17/05/2025 - // Originally the damage radius was calculated with a value updated by LaserUpdate::clientUpdate(). - // To no longer rely on client updates, this class now maintains a logical copy of the visual laser radius. - m_orbitToTargetLaserRadius.updateRadius(); - const Real logicalLaserRadius = update->getTemplateLaserRadius() * m_orbitToTargetLaserRadius.getWidthScale(); - damageRadius = logicalLaserRadius * data->m_damageRadiusScalar; -#if RETAIL_COMPATIBLE_XFER_CRC - DEBUG_ASSERTCRASH(logicalLaserRadius == visualLaserRadius, - ("ParticleUplinkCannonUpdate's laser radius does not match LaserUpdate's laser radius - will cause mismatch in VS6 retail compatible builds\n")); -#endif + static NameKeyType nameKeyClientUpdate = NAMEKEY( "LaserUpdate" ); + LaserUpdate *update = (LaserUpdate*)beam->findClientUpdateModule( nameKeyClientUpdate ); + if( update ) + { + update->initLaser( NULL, NULL, &orbitPosition, &m_currentTargetPosition, "" ); + // TheSuperHackers @info The GameLogic has a dependency on this drawable. + // @todo The logical laser radius for the damage should probably be part of ParticleUplinkCannonUpdateModuleData. + templateLaserRadius = update->getTemplateLaserRadius(); + visualLaserRadius = update->getCurrentLaserRadius(); + } } + // TheSuperHackers @refactor helmutbuhler/xezon 17/05/2025 + // Originally the damageRadius was calculated with a value updated by LaserUpdate::clientUpdate. + // To no longer rely on GameClient updates, this class now maintains a copy of the LaserRadiusUpdate. + m_orbitToTargetLaserRadius.updateRadius(); + const Real logicalLaserRadius = templateLaserRadius * m_orbitToTargetLaserRadius.getWidthScale(); + damageRadius = logicalLaserRadius * data->m_damageRadiusScalar; + scorchRadius = logicalLaserRadius * data->m_scorchMarkScalar; + DEBUG_ASSERTCRASH_RETAIL_COMPATIBLE_CRC(logicalLaserRadius == visualLaserRadius, + ("ParticleUplinkCannonUpdate's laser radius does not match LaserUpdate's laser radius - will cause mismatch in VS6 retail compatible builds\n")); //Create scorch marks periodically if( m_nextScorchMarkFrame <= now ) @@ -988,13 +996,15 @@ void ParticleUplinkCannonUpdate::createOrbitToTargetLaser( UnsignedInt growthFra { const ParticleUplinkCannonUpdateModuleData *data = getParticleUplinkCannonUpdateModuleData(); - Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); - if( beam ) + if ( m_orbitToTargetBeamID != INVALID_DRAWABLE_ID ) { - TheAudio->removeAudioEvent( m_annihilationSound.getPlayingHandle() ); - TheGameClient->destroyDrawable( beam ); + Drawable *beam = TheGameClient->findDrawableByID( m_orbitToTargetBeamID ); + if( beam ) + { + TheAudio->removeAudioEvent( m_annihilationSound.getPlayingHandle() ); + TheGameClient->destroyDrawable( beam ); + } m_orbitToTargetBeamID = INVALID_DRAWABLE_ID; - m_orbitToTargetLaserRadius = LaserRadiusUpdate(); } if( data->m_particleBeamLaserName.isNotEmpty() ) @@ -1014,7 +1024,6 @@ void ParticleUplinkCannonUpdate::createOrbitToTargetLaser( UnsignedInt growthFra orbitPosition.set( &m_initialTargetPosition ); orbitPosition.z += 500.0f; update->initLaser( NULL, NULL, &orbitPosition, &m_initialTargetPosition, "", growthFrames ); - m_orbitToTargetLaserRadius.initRadius( growthFrames ); } } } @@ -1025,6 +1034,9 @@ void ParticleUplinkCannonUpdate::createOrbitToTargetLaser( UnsignedInt growthFra m_annihilationSound.setPlayingHandle( TheAudio->addAudioEvent( &m_annihilationSound ) ); } } + + m_orbitToTargetLaserRadius = LaserRadiusUpdate(); + m_orbitToTargetLaserRadius.initRadius( growthFrames ); } //------------------------------------------------------------------------------------------------- From ee498bcbbdf5fa7501993f033f201640f1737255 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Thu, 29 May 2025 22:35:40 +0200 Subject: [PATCH 2/3] Revert changes to Debug.h --- Generals/Code/GameEngine/Include/Common/Debug.h | 11 ----------- .../Object/Update/ParticleUplinkCannonUpdate.cpp | 4 +++- GeneralsMD/Code/GameEngine/Include/Common/Debug.h | 11 ----------- .../Object/Update/ParticleUplinkCannonUpdate.cpp | 4 +++- 4 files changed, 6 insertions(+), 24 deletions(-) diff --git a/Generals/Code/GameEngine/Include/Common/Debug.h b/Generals/Code/GameEngine/Include/Common/Debug.h index ec486237e1a..829946295e0 100644 --- a/Generals/Code/GameEngine/Include/Common/Debug.h +++ b/Generals/Code/GameEngine/Include/Common/Debug.h @@ -48,8 +48,6 @@ #ifndef __DEBUG_H_ #define __DEBUG_H_ -#include "Common/GameDefines.h" - class AsciiString; #if defined(RTS_DEBUG) && defined(RTS_INTERNAL) @@ -215,15 +213,6 @@ class AsciiString; #endif -#if defined(RETAIL_COMPATIBLE_CRC) - #define DEBUG_CRASH_RETAIL_COMPATIBLE_CRC(c, m) DEBUG_CRASH(m) - #define DEBUG_ASSERTCRASH_RETAIL_COMPATIBLE_CRC(c, m) DEBUG_ASSERTCRASH(c, m) -#else - #define DEBUG_CRASH_RETAIL_COMPATIBLE_CRC(c, m) ((void)0) - #define DEBUG_ASSERTCRASH_RETAIL_COMPATIBLE_CRC(c, m) ((void)0) -#endif - - DEBUG_EXTERN_C void ReleaseCrash(const char* reason); DEBUG_EXTERN_C void ReleaseCrashLocalized(const AsciiString& p, const AsciiString& m); diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp index d67521066fa..f54020d1b67 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp @@ -575,8 +575,10 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update() const Real logicalLaserRadius = templateLaserRadius * m_orbitToTargetLaserRadius.getWidthScale(); damageRadius = logicalLaserRadius * data->m_damageRadiusScalar; scorchRadius = logicalLaserRadius * data->m_scorchMarkScalar; - DEBUG_ASSERTCRASH_RETAIL_COMPATIBLE_CRC(logicalLaserRadius == visualLaserRadius, +#if defined(RETAIL_COMPATIBLE_CRC) + DEBUG_ASSERTCRASH(logicalLaserRadius == visualLaserRadius, ("ParticleUplinkCannonUpdate's laser radius does not match LaserUpdate's laser radius - will cause mismatch in VS6 retail compatible builds\n")); +#endif //Create scorch marks periodically if( m_nextScorchMarkFrame <= now ) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/Debug.h b/GeneralsMD/Code/GameEngine/Include/Common/Debug.h index ddf85bac65a..fe873feeaf6 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/Debug.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/Debug.h @@ -48,8 +48,6 @@ #ifndef __DEBUG_H_ #define __DEBUG_H_ -#include "Common/GameDefines.h" - class AsciiString; #if defined(RTS_DEBUG) && defined(RTS_INTERNAL) @@ -221,15 +219,6 @@ class AsciiString; #endif -#if defined(RETAIL_COMPATIBLE_CRC) - #define DEBUG_CRASH_RETAIL_COMPATIBLE_CRC(c, m) DEBUG_CRASH(m) - #define DEBUG_ASSERTCRASH_RETAIL_COMPATIBLE_CRC(c, m) DEBUG_ASSERTCRASH(c, m) -#else - #define DEBUG_CRASH_RETAIL_COMPATIBLE_CRC(c, m) ((void)0) - #define DEBUG_ASSERTCRASH_RETAIL_COMPATIBLE_CRC(c, m) ((void)0) -#endif - - DEBUG_EXTERN_C void ReleaseCrash(const char* reason); DEBUG_EXTERN_C void ReleaseCrashLocalized(const AsciiString& p, const AsciiString& m); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp index 68960c2a497..da649ab6a3d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp @@ -636,8 +636,10 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update() const Real logicalLaserRadius = templateLaserRadius * m_orbitToTargetLaserRadius.getWidthScale(); damageRadius = logicalLaserRadius * data->m_damageRadiusScalar; scorchRadius = logicalLaserRadius * data->m_scorchMarkScalar; - DEBUG_ASSERTCRASH_RETAIL_COMPATIBLE_CRC(logicalLaserRadius == visualLaserRadius, +#if defined(RETAIL_COMPATIBLE_CRC) + DEBUG_ASSERTCRASH(logicalLaserRadius == visualLaserRadius, ("ParticleUplinkCannonUpdate's laser radius does not match LaserUpdate's laser radius - will cause mismatch in VS6 retail compatible builds\n")); +#endif //Create scorch marks periodically if( m_nextScorchMarkFrame <= now ) From 2bceec7281e3879326ee292cb4830538395b2f6d Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Wed, 4 Jun 2025 22:06:08 +0200 Subject: [PATCH 3/3] Update comment --- .../GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp | 4 ++-- .../GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp index f54020d1b67..55610d153f3 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp @@ -562,8 +562,8 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update() if( update ) { update->initLaser( NULL, &orbitPosition, &m_currentTargetPosition ); - // TheSuperHackers @info The GameLogic has a dependency on this drawable. - // @todo The logical laser radius for the damage should probably be part of ParticleUplinkCannonUpdateModuleData. + // TheSuperHackers @logic-client-separation The GameLogic has a dependency on this drawable. + // The logical laser radius for the damage should probably be part of ParticleUplinkCannonUpdateModuleData. templateLaserRadius = update->getTemplateLaserRadius(); visualLaserRadius = update->getCurrentLaserRadius(); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp index da649ab6a3d..ba9035085d2 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp @@ -623,8 +623,8 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update() if( update ) { update->initLaser( NULL, NULL, &orbitPosition, &m_currentTargetPosition, "" ); - // TheSuperHackers @info The GameLogic has a dependency on this drawable. - // @todo The logical laser radius for the damage should probably be part of ParticleUplinkCannonUpdateModuleData. + // TheSuperHackers @logic-client-separation The GameLogic has a dependency on this drawable. + // The logical laser radius for the damage should probably be part of ParticleUplinkCannonUpdateModuleData. templateLaserRadius = update->getTemplateLaserRadius(); visualLaserRadius = update->getCurrentLaserRadius(); }