mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
To avoid issues when somebody calls `GetRemainingRaidSeconds()` or `GetRaidTimeRemainingFraction()` when a raid isn't in progress, I throw an exception if `GameTimer` isn't running. However, this can be confusing for modders since `GameTimer` starts well after `GameWorld` is instantiated. Therefore, I added a new `HasRaidStarted()` method so it's more clear when these methods can be called. Additionally, I updated the documentation for those methods to warn the user that `HasRaidStarted()` must be true or they'll throw an exception. Alternatively, I can change the return type from `float` to `float?` for those methods and return null if a raid hasn't started. However, I felt like a null response is less intuitive than an exception in this case. Co-authored-by: dwesterwick <dwesterwick@yahoo.com> Reviewed-on: SPT-AKI/Modules#41 Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com> Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>