BSG added a new handler that's called when a new quest is added to the
quest list, this handler results in the first quest in a trader's task
list being selected whenever a new quest is added. This has the negative
effect of breaking replacing dailies for a trader with a daily from that
same trader, due to the selection happening _before_ the daily is
removed. Essentially resulting in a race condition where the code to
remove the old daily tries to remove the trader's first quest instead.
We can work around it by conditioning the call to `AutoSelectQuest` in
QuestAddedHandler. This does cause a change in behaviour from live, but
fixes the client freezing when getting a new daily from the trader
you're replacing the daily on.
Note: While this fixes a BSG bug, we can't avoid fixing it, because it
causes the UI to freeze when replacing daily quests We can retire this
patch once BSG fixes the underlying bug.
This synchronizes 310-dev with the later changes in master, resulting in
a clean merge of 310-dev into master
Supersedes #4 as that PR was missing a variable used elsewhere in the
codebase (Sorry Archangel!)
Make the GC only run on show inventory screen, and only allow it to run for a maximum of 25 milliseconds at a time.
Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com>
Reviewed-on: SPT/Modules#178
Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com>
Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
Attempt at slowing down the memory leak caused by bots spawning/dying
Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com>
Reviewed-on: SPT/Modules#177
Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com>
Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>