1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 00:34:46 +01:00

Close #12394: Refactor PeepNauseaTolerance to use strong enum (#13106)

This commit is contained in:
Vinicius Sa
2020-10-05 22:13:44 -03:00
committed by GitHub
parent 797fe48b0f
commit bd8c633ea3
10 changed files with 26 additions and 25 deletions

View File

@@ -15,6 +15,7 @@
# include "../common.h"
# include "../peep/Peep.h"
# include "../peep/Staff.h"
# include "../util/Util.h"
# include "../world/Sprite.h"
# include "Duktape.hpp"
# include "ScRide.hpp"
@@ -1024,7 +1025,7 @@ namespace OpenRCT2::Scripting
uint8_t nauseaTolerance_get() const
{
auto peep = GetPeep();
return peep != nullptr ? peep->NauseaTolerance : 0;
return peep != nullptr ? EnumValue(peep->NauseaTolerance) : 0;
}
void nauseaTolerance_set(uint8_t value)
{
@@ -1032,7 +1033,7 @@ namespace OpenRCT2::Scripting
auto peep = GetPeep();
if (peep != nullptr)
{
peep->NauseaTolerance = std::min<uint8_t>(value, 3);
peep->NauseaTolerance = static_cast<PeepNauseaTolerance>(std::min<uint8_t>(value, 3));
}
}