Page MenuHomeFeedback Tracker

SCR_MapMarkerManagerComponent Bug / oversight?
Awaiting internal Testing, NormalPublic

Description

Game Version number: 1.2.0.76
Modded?: Yes and no
If modded, please list the mods: N/A

Issue Description:
Not sure if it was a design oversight but SCR_MapMarkerManagerComponent has a bug where sometimes a static marker cannot be removed, after countless hours / days of pulling my hair out I think I've found the reason for it and it's due to the overall design of the scripted system.
When you add a static marker it's stored in an array called m_aStaticMarkers, that's cool and all but there is additional processes happening specifically in Update where I can only assume it's checking for markers within the camera pan of the map view, if they're outside of the view they get added to an array called m_aDisabledMarkers and removed from m_aStaticMarkers.

So what's the issue? The issue is in the call chain of the removal. When you want to remove a static marker you call RemoveStaticMarker this eventually leads to OnRemoveSynchedMarker which only searches and removes from m_aStaticMarkers and not m_aDisabledMarkers so if a user is panning around in the map and that marker is "disabled / out of view" when the event is called they will get stuck with a static marker that will never be removed.

Possible solution:

SCR_MapMarkerBase GetStaticMarkerByID(int markerID)
{
	foreach ( SCR_MapMarkerBase marker : m_aStaticMarkers )
	{
		if (markerID == marker.GetMarkerID())
			return marker;
	}
		
	foreach ( SCR_MapMarkerBase marker : m_aDisabledMarkers )
	{
		if (markerID == marker.GetMarkerID())
			return marker;
	}
	
	return null;
}

void OnRemoveSynchedMarker(int markerID)
{
    SCR_MapMarkerBase marker = GetStaticMarkerByID(markerID);

    if (marker)
        marker.OnDelete();
        
    m_aStaticMarkers.RemoveItem(marker);
    m_aDisabledMarkers.RemoveItem(marker);
}

Or just some other solution entirely where you have a master list of markers and then you have the static array and disabled array.. Or a flag in the mapmarkerbase its self saying its disabled and using only the array m_aStaticMarkers

Details

Severity
Tweak
Resolution
Open
Reproducibility
Random
Operating System
Windows 10 x64
Category
General
Steps To Reproduce
  • Create static marker at 0,0,0
  • Zoom all the way in on the map or keep coordinate 0,0,0 out of pan
  • Call RemoveStaticMarker
  • Zoom out or get 0,0,0 in camera pan
  • Be disappointed that the marker is there

I've included a scripted class to use for reproducing. Just call MarkerTest.GetInstance().RunTest(); with remote console

Additional Information

Here is a video showing the issue:
SCR_MapMarkerManagerComponent Issue

Event Timeline

Tonic-_- updated the task description. (Show Details)Jul 18 2024, 11:53 AM
Geez changed the task status from New to Awaiting internal Testing.Jul 18 2024, 1:47 PM