1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 19:43:06 +01:00

Make the compiler happy

This commit is contained in:
ζeh Matt
2024-01-11 19:45:07 +02:00
parent 88a0e4b8d4
commit 6eea65fac7

View File

@@ -1597,10 +1597,12 @@ void ScriptEngine::SetParkStorageFromJSON(std::string_view value)
IntervalHandle ScriptEngine::AllocateHandle()
{
// In case of overflow start from 1 again
_nextIntervalHandle = std::max(_nextIntervalHandle++, 1U);
const auto nextHandle = _nextIntervalHandle;
return _nextIntervalHandle;
// In case of overflow start from 1 again
_nextIntervalHandle = std::max(_nextIntervalHandle + 1U, 1U);
return nextHandle;
}
IntervalHandle ScriptEngine::AddInterval(const std::shared_ptr<Plugin>& plugin, int32_t delay, bool repeat, DukValue&& callback)