0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 03:10:45 -05:00
DanW 1c7888b446 Improve Robustness of RaidChangesUtil and RaidTimeUtil (!45)
While continuing mod development with SPT 3.7.4 (namely for Questing Bots and SAIN), I found that the API I added to SPT 3.7.4 is unintuitive and clunky to use after the raid is done loading but before the countdown timer expires. With the current SPT code, calling `GetRemainingRaidSeconds()` or `GetRaidTimeRemainingFraction()` will result in an exception during this time unless you check `HasRaidStarted()` first.

These changes will prevent those methods from throwing an exception unless you try calling them before a raid has finished loading (which should rarely happen). This allows mods to more easily do things using `GetRemainingRaidSeconds()` or `GetRaidTimeRemainingFraction()` before the countdown timer expires (i.e. cache bots).

These changes only improve the robustness of the existing code and will not break any mods that use the existing API.

Co-authored-by: dwesterwick <dwesterwick@yahoo.com>
Co-authored-by: chomp <chomp@noreply.dev.sp-tarkov.com>
Reviewed-on: SPT-AKI/Modules#45
Co-authored-by: DanW <danw@noreply.dev.sp-tarkov.com>
Co-committed-by: DanW <danw@noreply.dev.sp-tarkov.com>
2023-12-21 22:31:33 +00:00
..
2023-11-12 13:52:54 +00:00
2023-12-19 21:15:04 +00:00
2023-10-10 10:58:33 +00:00
2023-10-10 12:18:01 +01:00
2023-03-03 18:52:31 +00:00
2023-03-03 18:52:31 +00:00
2023-03-03 18:52:31 +00:00