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
2 changes: 1 addition & 1 deletion Core/GameEngine/Include/Common/GameDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#endif

#ifndef PRESERVE_RADAR_WARNING_SUPPRESSION
#define PRESERVE_RADAR_WARNING_SUPPRESSION (1)
#define PRESERVE_RADAR_WARNING_SUPPRESSION (0) // Per-object cooldown in tryUnderAttackEvent supersedes this map-wide suppression.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disabling another fix is not a proper solution. If this fix superseeds the previous fix and not backwards compatibility is needed, than the old fix needs to be removed. If it needs to be backwards compatible, than this macro should not be changed and your fix should be in the same macro tags (#if !PRESERVE_RADAR_WARNING_SUPPRESSION)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming this fix avoids the under attack audio spam, then PRESERVE_RADAR_WARNING_SUPPRESSION can be removed?

#endif

#ifndef PRESERVE_STRUCTURE_STEALTH_DURING_REPAIR
Expand Down
1 change: 1 addition & 0 deletions Core/GameEngine/Include/Common/Radar.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class RadarObject : public MemoryPoolObject,
Object *m_object; ///< the object
RadarObject *m_next; ///< next radar object
Color m_color; ///< color to draw for this object on the radar
UnsignedInt m_lastUnderAttackAlarmFrame; ///< last logic frame this object's under-attack alarm fired

};

Expand Down
13 changes: 13 additions & 0 deletions Core/GameEngine/Source/Common/System/Radar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
m_object = nullptr;
m_next = nullptr;
m_color = GameMakeColor( 255, 255, 255, 255 );
m_lastUnderAttackAlarmFrame = 0xFFFFFFFF;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for this init value?


}

Expand Down Expand Up @@ -1046,9 +1047,21 @@
if( obj == nullptr )
return;

// Per-object cooldown: each unit can alarm at most once per suppression window.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Contribution Guidelines give comment format. Needs comment prefix.

// This prevents a single object (e.g. a supply plane) from re-triggering the alarm
// every time the global event window expires.
const UnsignedInt framesBetweenAlarms = LOGICFRAMES_PER_SECOND * 10;
UnsignedInt currentFrame = TheGameLogic->getFrame();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const

RadarObject *radarData = obj->friend_getRadarData();

Check failure on line 1055 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-debug+t+e

'friend_getRadarData' : cannot convert 'this' pointer from 'const class Object' to 'class Object &'

Check failure on line 1055 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6+t+e

'friend_getRadarData' : cannot convert 'this' pointer from 'const class Object' to 'class Object &'

Check failure on line 1055 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / vc6+t+e

'friend_getRadarData' : cannot convert 'this' pointer from 'const class Object' to 'class Object &'

Check failure on line 1055 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-debug+t+e

'friend_getRadarData' : cannot convert 'this' pointer from 'const class Object' to 'class Object &'

Check failure on line 1055 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-profile+t+e

'friend_getRadarData' : cannot convert 'this' pointer from 'const class Object' to 'class Object &'

Check failure on line 1055 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-releaselog+t+e

'friend_getRadarData' : cannot convert 'this' pointer from 'const class Object' to 'class Object &'

Check failure on line 1055 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-profile+t+e

'friend_getRadarData' : cannot convert 'this' pointer from 'const class Object' to 'class Object &'

Check failure on line 1055 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / win32-debug+t+e

'RadarObject *Object::friend_getRadarData(void)': cannot convert 'this' pointer from 'const Object' to 'Object &'

Check failure on line 1055 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32-debug+t+e

'RadarObject *Object::friend_getRadarData(void)': cannot convert 'this' pointer from 'const Object' to 'Object &'

Check failure on line 1055 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / win32+t+e

'RadarObject *Object::friend_getRadarData(void)': cannot convert 'this' pointer from 'const Object' to 'Object &'

Check failure on line 1055 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32+t+e

'RadarObject *Object::friend_getRadarData(void)': cannot convert 'this' pointer from 'const Object' to 'Object &'

Check failure on line 1055 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / win32-profile+t+e

'RadarObject *Object::friend_getRadarData(void)': cannot convert 'this' pointer from 'const Object' to 'Object &'

Check failure on line 1055 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32-profile+t+e

'RadarObject *Object::friend_getRadarData(void)': cannot convert 'this' pointer from 'const Object' to 'Object &'
if( radarData && currentFrame - radarData->m_lastUnderAttackAlarmFrame < framesBetweenAlarms )

Check failure on line 1056 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-debug+t+e

'm_lastUnderAttackAlarmFrame' : cannot access protected member declared in class 'RadarObject'

Check failure on line 1056 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6+t+e

'm_lastUnderAttackAlarmFrame' : cannot access protected member declared in class 'RadarObject'

Check failure on line 1056 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / vc6+t+e

'm_lastUnderAttackAlarmFrame' : cannot access protected member declared in class 'RadarObject'

Check failure on line 1056 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-debug+t+e

'm_lastUnderAttackAlarmFrame' : cannot access protected member declared in class 'RadarObject'

Check failure on line 1056 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-profile+t+e

'm_lastUnderAttackAlarmFrame' : cannot access protected member declared in class 'RadarObject'

Check failure on line 1056 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-releaselog+t+e

'm_lastUnderAttackAlarmFrame' : cannot access protected member declared in class 'RadarObject'

Check failure on line 1056 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-profile+t+e

'm_lastUnderAttackAlarmFrame' : cannot access protected member declared in class 'RadarObject'

Check failure on line 1056 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / win32-debug+t+e

'RadarObject::m_lastUnderAttackAlarmFrame': cannot access protected member declared in class 'RadarObject'

Check failure on line 1056 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32-debug+t+e

'RadarObject::m_lastUnderAttackAlarmFrame': cannot access protected member declared in class 'RadarObject'

Check failure on line 1056 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / win32+t+e

'RadarObject::m_lastUnderAttackAlarmFrame': cannot access protected member declared in class 'RadarObject'

Check failure on line 1056 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32+t+e

'RadarObject::m_lastUnderAttackAlarmFrame': cannot access protected member declared in class 'RadarObject'

Check failure on line 1056 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / win32-profile+t+e

'RadarObject::m_lastUnderAttackAlarmFrame': cannot access protected member declared in class 'RadarObject'

Check failure on line 1056 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32-profile+t+e

'RadarObject::m_lastUnderAttackAlarmFrame': cannot access protected member declared in class 'RadarObject'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m_lastUnderAttackAlarmFrame has the maximum value assigned (line 103). This if statement is therefore always true. Therefore line 1063 will never fire and m_lastUnderAttackAlarmFrame will never be reset.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it even compile? m_lastUnderAttackAlarmFrame is protected.

return;

// try to create the event
Bool eventCreated = tryEvent( RADAR_EVENT_UNDER_ATTACK, obj->getPosition() );

if( eventCreated && radarData )

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests eventCreated twice which can be avoided.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests radarData twice. Can second test be avoided?

radarData->m_lastUnderAttackAlarmFrame = currentFrame;

Check failure on line 1063 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-debug+t+e

'm_lastUnderAttackAlarmFrame' : cannot access protected member declared in class 'RadarObject'

Check failure on line 1063 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6+t+e

'm_lastUnderAttackAlarmFrame' : cannot access protected member declared in class 'RadarObject'

Check failure on line 1063 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / vc6+t+e

'm_lastUnderAttackAlarmFrame' : cannot access protected member declared in class 'RadarObject'

Check failure on line 1063 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-debug+t+e

'm_lastUnderAttackAlarmFrame' : cannot access protected member declared in class 'RadarObject'

Check failure on line 1063 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / vc6-profile+t+e

'm_lastUnderAttackAlarmFrame' : cannot access protected member declared in class 'RadarObject'

Check failure on line 1063 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-releaselog+t+e

'm_lastUnderAttackAlarmFrame' : cannot access protected member declared in class 'RadarObject'

Check failure on line 1063 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / vc6-profile+t+e

'm_lastUnderAttackAlarmFrame' : cannot access protected member declared in class 'RadarObject'

Check failure on line 1063 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / win32-debug+t+e

'RadarObject::m_lastUnderAttackAlarmFrame': cannot access protected member declared in class 'RadarObject'

Check failure on line 1063 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32-debug+t+e

'RadarObject::m_lastUnderAttackAlarmFrame': cannot access protected member declared in class 'RadarObject'

Check failure on line 1063 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / win32+t+e

'RadarObject::m_lastUnderAttackAlarmFrame': cannot access protected member declared in class 'RadarObject'

Check failure on line 1063 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32+t+e

'RadarObject::m_lastUnderAttackAlarmFrame': cannot access protected member declared in class 'RadarObject'

Check failure on line 1063 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build Generals / win32-profile+t+e

'RadarObject::m_lastUnderAttackAlarmFrame': cannot access protected member declared in class 'RadarObject'

Check failure on line 1063 in Core/GameEngine/Source/Common/System/Radar.cpp

View workflow job for this annotation

GitHub Actions / Build GeneralsMD / win32-profile+t+e

'RadarObject::m_lastUnderAttackAlarmFrame': cannot access protected member declared in class 'RadarObject'

// if event created, do some more feedback
if( eventCreated )
{
Expand Down
Loading