0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:30:46 -05:00
DanW bf07137cf7 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-27 11:25:15 +00:00
..
2023-10-10 10:58:33 +00:00
2023-08-07 19:47:22 +01:00
2023-03-03 18:52:31 +00:00