Skip to content

Commit 89eff7c

Browse files
committed
Fixed lua spam about nograv area. Again.
1 parent b1f49a9 commit 89eff7c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Entities/Scene.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2334,15 +2334,16 @@ bool Scene::HasArea(std::string areaName)
23342334
//////////////////////////////////////////////////////////////////////////////////////////
23352335
// Description: Gets a specific area box identified by a name. Ownership is NOT transferred!
23362336

2337-
Scene::Area * Scene::GetArea(const std::string_view &areaName, bool luaWarnNotError) {
2337+
Scene::Area * Scene::GetArea(const std::string_view &areaName, bool required) {
23382338
for (Scene::Area &area : m_AreaList) {
23392339
if (area.GetName() == areaName) {
23402340
return &area;
23412341
}
23422342
}
23432343

2344-
std::string luaMessageStart = luaWarnNotError ? "WARNING" : "ERROR";
2345-
g_ConsoleMan.PrintString(luaMessageStart + ": Could not find the requested Scene Area named: " + areaName.data());
2344+
if (required) {
2345+
g_ConsoleMan.PrintString("WARNING: Could not find the requested Scene Area named : " + areaName.data());
2346+
}
23462347

23472348
return nullptr;
23482349
}

Entities/Scene.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -933,9 +933,9 @@ const SceneObject * PickPlacedActorInRange(int whichSet, Vector &scenePoint, int
933933
/// Gets a specified Area identified by name. Ownership is NOT transferred!
934934
/// </summary>
935935
/// <param name="areaName">The name of the Area to try to get.</param>
936-
/// <param name="luaWarnNotError">Whether to warn or error in the Lua console. True is warn, false is error.</param>
936+
/// <param name="required">Whether the area is required, and should throw an error if not found.</param>
937937
/// <returns>A pointer to the Area asked for, or nullptr if no Area of that name was found.</returns>
938-
Area * GetArea(const std::string_view &areaName, bool luaWarnNotError);
938+
Area * GetArea(const std::string_view &areaName, bool required = false);
939939

940940
/// <summary>
941941
/// Gets a specified Area identified by name, showing a Lua error if it's not found. Ownership is NOT transferred!

0 commit comments

Comments
 (0)