Add location to error messages

This commit is contained in:
Peter Froud 2024-03-16 23:36:22 -07:00 committed by Gymnasiast
parent 257c2d45d3
commit 226fc4cb00
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
2 changed files with 5 additions and 5 deletions

View File

@ -77,7 +77,7 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const
auto tileElement = MapGetFootpathElement(_loc);
if (tileElement == nullptr)
{
LOG_ERROR("Could not find path element.");
LOG_ERROR("Could not find path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
}
@ -153,7 +153,7 @@ GameActions::Result FootpathAdditionPlaceAction::Execute() const
if (pathElement == nullptr)
{
LOG_ERROR("Could not find path element.");
LOG_ERROR("Could not find path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE);
}

View File

@ -69,14 +69,14 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const
auto tileElement = MapGetFootpathElement(_loc);
if (tileElement == nullptr)
{
LOG_ERROR("Could not find path element.");
LOG_ERROR("Could not find path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
}
auto pathElement = tileElement->AsPath();
if (pathElement == nullptr)
{
LOG_ERROR("Could not find path element.");
LOG_ERROR("Could not find path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
}
@ -101,7 +101,7 @@ GameActions::Result FootpathAdditionRemoveAction::Execute() const
if (pathElement == nullptr)
{
LOG_ERROR("Could not find path element.");
LOG_ERROR("Could not find path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE);
}