Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Object *ResourceGatheringManager::findBestSupplyCenter( Object *queryObject )
if( dock )
{
static const NameKeyType key_centerUpdate = NAMEKEY("SupplyCenterDockUpdate");
SupplyWarehouseDockUpdate *centerModule = (SupplyWarehouseDockUpdate*)dock->findUpdateModule( key_centerUpdate );
SupplyCenterDockUpdate *centerModule = (SupplyCenterDockUpdate*)dock->findUpdateModule( key_centerUpdate );
//If remotely okay, let User win.
if( centerModule && computeRelativeCost( queryObject, dock, NULL ) != FLT_MAX )
return dock;
Expand All @@ -234,7 +234,7 @@ Object *ResourceGatheringManager::findBestSupplyCenter( Object *queryObject )

if( currentCenter == NULL )
{
iterator = m_supplyWarehouses.erase( iterator );
iterator = m_supplyCenters.erase( iterator );
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void SubsystemInterfaceList::addSubsystem(SubsystemInterface* sys)
void SubsystemInterfaceList::removeSubsystem(SubsystemInterface* sys)
{
#ifdef DUMP_PERF_STATS
for (SubsystemList::iterator it = m_allSubsystems.begin(); it != m_subsystems.end(); ++it)
for (SubsystemList::iterator it = m_allSubsystems.begin(); it != m_allSubsystems.end(); ++it)
{
if ( (*it) == sys) {
m_allSubsystems.erase(it);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2085,9 +2085,9 @@ Bool MilesAudioManager::killLowestPrioritySoundImmediately( AudioEventRTS *event

if( playing->m_audioEventRTS && playing->m_audioEventRTS == lowestPriorityEvent )
{
//Release this 3D sound channel immediately because we are going to play another sound in it's place.
//Release this sound channel immediately because we are going to play another sound in it's place.
releasePlayingAudio( playing );
m_playing3DSounds.erase( it );
m_playingSounds.erase( it );
return TRUE;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Object *ResourceGatheringManager::findBestSupplyCenter( Object *queryObject )
if( dock )
{
static const NameKeyType key_centerUpdate = NAMEKEY("SupplyCenterDockUpdate");
SupplyWarehouseDockUpdate *centerModule = (SupplyWarehouseDockUpdate*)dock->findUpdateModule( key_centerUpdate );
SupplyCenterDockUpdate *centerModule = (SupplyCenterDockUpdate*)dock->findUpdateModule( key_centerUpdate );

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This certainly was no runtime bug, because this pointer is just tested for null.

//If remotely okay, let User win.
if( centerModule && computeRelativeCost( queryObject, dock, NULL ) != FLT_MAX )
return dock;
Expand All @@ -234,7 +234,7 @@ Object *ResourceGatheringManager::findBestSupplyCenter( Object *queryObject )

if( currentCenter == NULL )
{
iterator = m_supplyWarehouses.erase( iterator );
iterator = m_supplyCenters.erase( iterator );
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void SubsystemInterfaceList::addSubsystem(SubsystemInterface* sys)
void SubsystemInterfaceList::removeSubsystem(SubsystemInterface* sys)
{
#ifdef DUMP_PERF_STATS
for (SubsystemList::iterator it = m_allSubsystems.begin(); it != m_subsystems.end(); ++it)
for (SubsystemList::iterator it = m_allSubsystems.begin(); it != m_allSubsystems.end(); ++it)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a debug bug fix. No concern for retail game.

{
if ( (*it) == sys) {
m_allSubsystems.erase(it);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2087,9 +2087,9 @@ Bool MilesAudioManager::killLowestPrioritySoundImmediately( AudioEventRTS *event

if( playing->m_audioEventRTS && playing->m_audioEventRTS == lowestPriorityEvent )
{
//Release this 3D sound channel immediately because we are going to play another sound in it's place.
//Release this sound channel immediately because we are going to play another sound in it's place.
releasePlayingAudio( playing );
m_playing3DSounds.erase( it );
m_playingSounds.erase( it );

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I am 99% sure that this just worked with no bugs with stlport's implementation.

  iterator erase(iterator __position) {
    _List_node_base* __next_node = __position._M_node->_M_next; // accesses next node
    _List_node_base* __prev_node = __position._M_node->_M_prev; // accesses prev node
    _Node* __n = (_Node*) __position._M_node; // accesses current node
    __prev_node->_M_next = __next_node; // writes prev node
    __next_node->_M_prev = __prev_node; // writes next node
    _Destroy(&__n->_M_data); // calls destructor with the same type (PlayingAudio*)
    this->_M_node.deallocate(__n, 1); // calls deallocate on default allocator for std::list
    return iterator((_Node*)__next_node); // return local
    }

Same with m_supplyCenters.erase( iterator )

So these were no runtime issues in the retail game.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That is funny that it essentially looks like it does not care what container it is called on, just that erase is called with an iterator.

return TRUE;
}
}
Expand Down