1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-19 00:17:56 +02:00

vcmi: use std::optional

This commit is contained in:
Konstantin
2023-04-16 20:42:56 +03:00
parent 0d35606a44
commit 7a5775a9f9
135 changed files with 552 additions and 585 deletions

View File

@ -2050,11 +2050,11 @@ void NewTurn::applyGs(CGameState *gs)
if (playerState.daysWithoutCastle)
++(*playerState.daysWithoutCastle);
else
playerState.daysWithoutCastle = boost::make_optional(0);
playerState.daysWithoutCastle = std::make_optional(0);
}
else
{
playerState.daysWithoutCastle = boost::none;
playerState.daysWithoutCastle = std::nullopt;
}
}
}
@ -2085,7 +2085,7 @@ void SetObjectProperty::applyGs(CGameState * gs) const
//reset counter before NewTurn to avoid no town message if game loaded at turn when one already captured
if(p->daysWithoutCastle)
p->daysWithoutCastle = boost::none;
p->daysWithoutCastle = std::nullopt;
}
}