mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-26 08:14:38 +01:00
This commit is contained in:
@@ -126,20 +126,14 @@ namespace OpenRCT2::Scripting
|
||||
}
|
||||
};
|
||||
|
||||
using IntervalHandle = int32_t;
|
||||
using IntervalHandle = uint32_t;
|
||||
struct ScriptInterval
|
||||
{
|
||||
std::shared_ptr<Plugin> Owner;
|
||||
IntervalHandle Handle{};
|
||||
uint32_t Delay{};
|
||||
int64_t LastTimestamp{};
|
||||
DukValue Callback;
|
||||
bool Repeat{};
|
||||
|
||||
bool IsValid() const
|
||||
{
|
||||
return Handle != 0;
|
||||
}
|
||||
};
|
||||
|
||||
class ScriptEngine
|
||||
@@ -162,7 +156,8 @@ namespace OpenRCT2::Scripting
|
||||
DukValue _parkStorage;
|
||||
|
||||
uint32_t _lastIntervalTimestamp{};
|
||||
std::vector<ScriptInterval> _intervals;
|
||||
std::map<IntervalHandle, ScriptInterval> _intervals;
|
||||
IntervalHandle _nextIntervalHandle = 1;
|
||||
|
||||
std::unique_ptr<FileWatcher> _pluginFileWatcher;
|
||||
std::unordered_set<std::string> _changedPluginFiles;
|
||||
|
||||
Reference in New Issue
Block a user