This repository was archived by the owner on Jan 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -2289,16 +2289,17 @@ bool Scene::HasArea(string areaName)
2289
2289
// ////////////////////////////////////////////////////////////////////////////////////////
2290
2290
// Description: Gets a specific area box identified by a name. Ownership is NOT transferred!
2291
2291
2292
- Scene::Area * Scene::GetArea (string areaName)
2293
- {
2294
- for (list<Area>::iterator aItr = m_AreaList.begin (); aItr != m_AreaList.end (); ++aItr)
2295
- {
2296
- if ((*aItr).GetName () == areaName)
2297
- return &(*aItr);
2298
- }
2292
+ Scene::Area * Scene::GetArea (const std::string_view &areaName, bool luaWarnNotError) {
2293
+ for (Scene::Area &area : m_AreaList) {
2294
+ if (area.GetName () == areaName) {
2295
+ return &area;
2296
+ }
2297
+ }
2299
2298
2300
- g_ConsoleMan.PrintString (" ERROR: Could not find the requested Scene Area named: " + areaName);
2301
- return 0 ;
2299
+ std::string luaMessageStart = luaWarnNotError ? " WARNING" : " ERROR" ;
2300
+ g_ConsoleMan.PrintString (luaMessageStart + " : Could not find the requested Scene Area named: " + areaName.data ());
2301
+
2302
+ return nullptr ;
2302
2303
}
2303
2304
2304
2305
You can’t perform that action at this time.
0 commit comments