Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit b29c1e2

Browse files
committed
Merge branch 'pre4-testing' into 4zk-content-source
2 parents 268e9e6 + ffa5b3d commit b29c1e2

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Entities/Scene.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,16 +2289,17 @@ bool Scene::HasArea(string areaName)
22892289
//////////////////////////////////////////////////////////////////////////////////////////
22902290
// Description: Gets a specific area box identified by a name. Ownership is NOT transferred!
22912291

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+
}
22992298

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;
23022303
}
23032304

23042305

0 commit comments

Comments
 (0)