mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
vcmi: use std::optional
This commit is contained in:
@ -396,10 +396,10 @@ CDrawTerrainOperation::ValidationResult CDrawTerrainOperation::validateTerrainVi
|
||||
{
|
||||
if(terType->getId() == centerTerType->getId())
|
||||
{
|
||||
const auto & patternForRule = VLC->terviewh->getTerrainViewPatternsById(centerTerType->getId(), rule.name);
|
||||
const auto patternForRule = VLC->terviewh->getTerrainViewPatternsById(centerTerType->getId(), rule.name);
|
||||
if(auto p = patternForRule)
|
||||
{
|
||||
auto rslt = validateTerrainView(currentPos, &(*p), 1);
|
||||
auto rslt = validateTerrainView(currentPos, &(p->get()), 1);
|
||||
if(rslt.result) topPoints = std::max(topPoints, rule.points);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user