diff --git a/Generals/Code/GameEngine/Include/GameLogic/PolygonTrigger.h b/Generals/Code/GameEngine/Include/GameLogic/PolygonTrigger.h index 5040a409f1b..d3e133834fc 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/PolygonTrigger.h +++ b/Generals/Code/GameEngine/Include/GameLogic/PolygonTrigger.h @@ -125,7 +125,7 @@ class PolygonTrigger : public MemoryPoolObject, Int getID() const {return m_triggerID;} PolygonTrigger *getNext() {return m_nextPolygonTrigger;} const PolygonTrigger *getNext() const {return m_nextPolygonTrigger;} - AsciiString getTriggerName() const {return m_triggerName;} ///< Gets the trigger name. + const AsciiString& getTriggerName() const {return m_triggerName;} ///< Gets the trigger name. Bool pointInTrigger(ICoord3D &point) const; Bool doExportWithScripts() const {return m_exportWithScripts;} void setDoExportWithScripts(Bool val) {m_exportWithScripts = val;} diff --git a/Generals/Code/GameEngine/Include/GameLogic/TerrainLogic.h b/Generals/Code/GameEngine/Include/GameLogic/TerrainLogic.h index 6c16228c569..ad1db103499 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/TerrainLogic.h +++ b/Generals/Code/GameEngine/Include/GameLogic/TerrainLogic.h @@ -112,11 +112,11 @@ class Waypoint : public MemoryPoolObject /// Get the waypoint's position const Coord3D *getLocation() const { return &m_location; } /// Get the waypoint's first path label - AsciiString getPathLabel1() const { return m_pathLabel1; } + const AsciiString& getPathLabel1() const { return m_pathLabel1; } /// Get the waypoint's second path label - AsciiString getPathLabel2() const { return m_pathLabel2; } + const AsciiString& getPathLabel2() const { return m_pathLabel2; } /// Get the waypoint's third path label - AsciiString getPathLabel3() const { return m_pathLabel3; } + const AsciiString& getPathLabel3() const { return m_pathLabel3; } /// Get bi-directionality. Bool getBiDirectional() const { return m_biDirectional; } diff --git a/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp index aa5e8887434..1d3e62df570 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp @@ -1633,7 +1633,7 @@ Bool TerrainLogic::isPurposeOfPath( Waypoint *pWay, AsciiString label ) PolygonTrigger *TerrainLogic::getTriggerAreaByName( AsciiString name ) { for (PolygonTrigger* pTrig = PolygonTrigger::getFirstPolygonTrigger(); pTrig; pTrig = pTrig->getNext()) { - AsciiString trigName = pTrig->getTriggerName(); + const AsciiString& trigName = pTrig->getTriggerName(); if (name == trigName) return pTrig; } diff --git a/Generals/Code/Tools/WorldBuilder/src/WaterOptions.cpp b/Generals/Code/Tools/WorldBuilder/src/WaterOptions.cpp index 7c1c0b4db55..9e3d04144d0 100644 --- a/Generals/Code/Tools/WorldBuilder/src/WaterOptions.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/WaterOptions.cpp @@ -162,7 +162,7 @@ void WaterOptions::OnChangeWaterEdit() PolygonTrigger *pTrig; for (pTrig=PolygonTrigger::getFirstPolygonTrigger(); !didMatch && pTrig; pTrig = pTrig->getNext()) { if (pTrig==theTrigger) continue; // don't check against yourself. - AsciiString trigName = pTrig->getTriggerName(); + const AsciiString& trigName = pTrig->getTriggerName(); if (name == trigName) { if (pTrig->isValid()) { didMatch = true; diff --git a/Generals/Code/Tools/WorldBuilder/src/WaypointOptions.cpp b/Generals/Code/Tools/WorldBuilder/src/WaypointOptions.cpp index e6608622f50..4b16a953ab3 100644 --- a/Generals/Code/Tools/WorldBuilder/src/WaypointOptions.cpp +++ b/Generals/Code/Tools/WorldBuilder/src/WaypointOptions.cpp @@ -486,7 +486,7 @@ void WaypointOptions::OnChangeWaypointnameEdit() PolygonTrigger *pTrig; for (pTrig=PolygonTrigger::getFirstPolygonTrigger(); !didMatch && pTrig; pTrig = pTrig->getNext()) { if (pTrig==theTrigger) continue; // don't check against yourself. - AsciiString trigName = pTrig->getTriggerName(); + const AsciiString& trigName = pTrig->getTriggerName(); if (name == trigName) { if (pTrig->isValid()) { didMatch = true; diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/PolygonTrigger.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/PolygonTrigger.h index 499ac57e6c2..d618de16a06 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/PolygonTrigger.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/PolygonTrigger.h @@ -137,7 +137,7 @@ class PolygonTrigger : public MemoryPoolObject, Int getID() const {return m_triggerID;} PolygonTrigger *getNext() {return m_nextPolygonTrigger;} const PolygonTrigger *getNext() const {return m_nextPolygonTrigger;} - AsciiString getTriggerName() const {return m_triggerName;} ///< Gets the trigger name. + const AsciiString& getTriggerName() const {return m_triggerName;} ///< Gets the trigger name. Bool pointInTrigger(ICoord3D &point) const; Bool doExportWithScripts() const {return m_exportWithScripts;} void setDoExportWithScripts(Bool val) {m_exportWithScripts = val;} diff --git a/GeneralsMD/Code/GameEngine/Include/GameLogic/TerrainLogic.h b/GeneralsMD/Code/GameEngine/Include/GameLogic/TerrainLogic.h index 8ff1964fb6a..90dda7f2411 100644 --- a/GeneralsMD/Code/GameEngine/Include/GameLogic/TerrainLogic.h +++ b/GeneralsMD/Code/GameEngine/Include/GameLogic/TerrainLogic.h @@ -112,11 +112,11 @@ class Waypoint : public MemoryPoolObject /// Get the waypoint's position const Coord3D *getLocation() const { return &m_location; } /// Get the waypoint's first path label - AsciiString getPathLabel1() const { return m_pathLabel1; } + const AsciiString& getPathLabel1() const { return m_pathLabel1; } /// Get the waypoint's second path label - AsciiString getPathLabel2() const { return m_pathLabel2; } + const AsciiString& getPathLabel2() const { return m_pathLabel2; } /// Get the waypoint's third path label - AsciiString getPathLabel3() const { return m_pathLabel3; } + const AsciiString& getPathLabel3() const { return m_pathLabel3; } /// Get bi-directionality. Bool getBiDirectional() const { return m_biDirectional; } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp index d6144eb2bdb..021059da065 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Map/TerrainLogic.cpp @@ -1633,7 +1633,7 @@ Bool TerrainLogic::isPurposeOfPath( Waypoint *pWay, AsciiString label ) PolygonTrigger *TerrainLogic::getTriggerAreaByName( AsciiString name ) { for (PolygonTrigger* pTrig = PolygonTrigger::getFirstPolygonTrigger(); pTrig; pTrig = pTrig->getNext()) { - AsciiString trigName = pTrig->getTriggerName(); + const AsciiString& trigName = pTrig->getTriggerName(); if (name == trigName) return pTrig; } diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/LayersList.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/LayersList.cpp index c55d2d57f62..f96502efd14 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/LayersList.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/LayersList.cpp @@ -447,7 +447,7 @@ void LayersList::updateUIFromList() } for (ListPolygonTriggerPtrIt triggerIt = layersIt->polygonTriggersInLayer.begin(); triggerIt != layersIt->polygonTriggersInLayer.end(); ++triggerIt) { - AsciiString uniqueID = (*triggerIt)->getTriggerName(); + const AsciiString& uniqueID = (*triggerIt)->getTriggerName(); pTree->InsertItem(uniqueID.str(), iconToShow, iconToShow, thisBranch); } } @@ -609,7 +609,7 @@ void LayersList::addPolygonTriggerToLayer(IN PolygonTrigger *triggerToAdd, IN Li // only update this object. HTREEITEM hItem = findTreeLayerNamed(layerToAddTo->layerName); if (hItem) { - AsciiString triggerName = triggerToAdd->getTriggerName(); + const AsciiString& triggerName = triggerToAdd->getTriggerName(); int iconToShow = (layerToAddTo->show ? 0 : 1); mTree->InsertItem(triggerName.str(), iconToShow, iconToShow, hItem); } @@ -691,7 +691,7 @@ void LayersList::removePolygonTriggerFromLayer(IN PolygonTrigger *triggerToRemov // only remove this object HTREEITEM layer = findTreeLayerNamed(layerToRemoveFrom->layerName); if (layer) { - AsciiString triggerUID = (*triggerBeingRemove)->getTriggerName(); + const AsciiString& triggerUID = (*triggerBeingRemove)->getTriggerName(); HTREEITEM itemToDelete = findTreeObjectNamed(triggerUID.str(), layer); if (itemToDelete) { mTree->DeleteItem(itemToDelete); @@ -1227,7 +1227,7 @@ Bool LayersList::findAndSelectPolygonTrigger(AsciiString selectedItemAsciiString PolygonTrigger *trigger = PolygonTrigger::getFirstPolygonTrigger(); while (trigger) { - AsciiString triggerName = trigger->getTriggerName(); + const AsciiString& triggerName = trigger->getTriggerName(); if (triggerName.compareNoCase(selectedItemAsciiString) == 0) { // Found it... select this object @@ -1307,7 +1307,7 @@ PolygonTrigger* LayersList::findPolygonTriggerByUID(AsciiString triggerIDToFind) PolygonTrigger *trigger = PolygonTrigger::getFirstPolygonTrigger(); while (trigger) { - AsciiString triggerName = trigger->getTriggerName(); + const AsciiString& triggerName = trigger->getTriggerName(); if (triggerName.compareNoCase(triggerIDToFind) == 0) { return (trigger); diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/WaterOptions.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/WaterOptions.cpp index a4c0b4f99fc..04e0f463ea9 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/WaterOptions.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/WaterOptions.cpp @@ -162,7 +162,7 @@ void WaterOptions::OnChangeWaterEdit() PolygonTrigger *pTrig; for (pTrig=PolygonTrigger::getFirstPolygonTrigger(); !didMatch && pTrig; pTrig = pTrig->getNext()) { if (pTrig==theTrigger) continue; // don't check against yourself. - AsciiString trigName = pTrig->getTriggerName(); + const AsciiString& trigName = pTrig->getTriggerName(); if (name == trigName) { if (pTrig->isValid()) { didMatch = true; diff --git a/GeneralsMD/Code/Tools/WorldBuilder/src/WaypointOptions.cpp b/GeneralsMD/Code/Tools/WorldBuilder/src/WaypointOptions.cpp index 9d6e68800b1..4ce35b40e57 100644 --- a/GeneralsMD/Code/Tools/WorldBuilder/src/WaypointOptions.cpp +++ b/GeneralsMD/Code/Tools/WorldBuilder/src/WaypointOptions.cpp @@ -486,7 +486,7 @@ void WaypointOptions::OnChangeWaypointnameEdit() PolygonTrigger *pTrig; for (pTrig=PolygonTrigger::getFirstPolygonTrigger(); !didMatch && pTrig; pTrig = pTrig->getNext()) { if (pTrig==theTrigger) continue; // don't check against yourself. - AsciiString trigName = pTrig->getTriggerName(); + const AsciiString& trigName = pTrig->getTriggerName(); if (name == trigName) { if (pTrig->isValid()) { didMatch = true;