This is primarily handled by the server, but the client does have precautionary code in it
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#86
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
1) The called bot's enemy position is being passed to TryCall, instead of the calling bot's enemy position. This is both incorrect and can lead to an NRE if the called bot has no enemy. Fix by passing in the calling bot's enemy position
2) In the TryCall method, the caller's enemy is added to the called bot, however the code doesn't verify that it was added before accessing it in the `EnemyInfos` array. This can throw a missing key exception if the bot failed to add to the enemies list. Fix by making sure the enemy is added to the enemy list before executing TryCall
3) When a BotOwner is disposed, the CalledData is never properly cleaned up, resulting in a bot's OnEnemyAdd being triggered after the bot has been killed, this can throw an NRE. Fix by calling CalledData.SetOff before BotOwner.Dispose
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#84
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Fixes an NRE when the BTR kills an enemy while using cover fire service
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#82
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
This makes SPT mimic live in how scav encyclopedia is handled
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#81
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
PR to fix transpiler patches, GInterface144 that was originally targeted no longer has get_Profile and has moved to GInterface146, so added patchconstants for it and fixed patches,
get_ProfileOfPet has also moved there.
Tested on both PMC and scav getting into raid, works fine, error was originally coming up on game start
Co-authored-by: CWXDEV <CWXDEV@outlook.com>
Reviewed-on: SPT-AKI/Modules#80
Co-authored-by: CWX <cwx@noreply.dev.sp-tarkov.com>
Co-committed-by: CWX <cwx@noreply.dev.sp-tarkov.com>
- Move clearing trader service data to raid end instead of as part of BTR Manager
- Fix data type for TraderServices ItemsToPay property
- Add ItemsToReceive property to TraderServices (Used for LK amulet)
- Don't throw NRE when nothing is bound to OnTraderServicePurchased
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#79
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
When exiting the hideout, the HideoutPlayer class ends up triggering a call in Player that calculates quest counter changes. This causes issues with quests that require not dying
The Player class however wraps these calls in a null check on the QuestController, so we can set it to null before ending the hideout session, and restore it afterwards to skip quest counter calculations
As Hideout Game end only triggers on start of a new raid, and not when you actually close the hideout, I can't think of any reason that quest counters should trigger in this scenario
Resolves: SPT-AKI/Issues#471
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#78
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
- Add a patch that's triggered when the item list for the scav post-raid screen is populated that stores the calculated item value
- Add a second patch that's triggered when the player confirms a Sell All, that uses a custom request object that contains the previously calculated sell price
I made these patches not directly depend on any GClass/Class names to avoid having to update them with new client versions, this did make the code a bit harder to follow, but I think it's still readable.
Requires server PR: SPT-AKI/Server#216
Resolves: SPT-AKI/Issues#410
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#77
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
**Description**
As of right now `ValidationUtil.cs` does not perform it's intended function, and the callers of it are not properly using the result.
Removed the redundant calls and implemented `GameValidationPatch.cs` to properly implement this behavior.
If the check fails;
1. All interface elements are disabled.
2. Notification popup is sent.
3. Logs are sent to the `Console`, `Server` and `BepInEx`.
**Related**
Closes: SPT-AKI/Issues#435
**Showcase**
https://streamable.com/2ra4sa
Co-authored-by: Deadly <info.saddiki@gmail.com>
Reviewed-on: SPT-AKI/Modules#76
Co-authored-by: Deadly Alden <deadly@noreply.dev.sp-tarkov.com>
Co-committed-by: Deadly Alden <deadly@noreply.dev.sp-tarkov.com>
* Turns out the Chainloader can be accessed from outside a BepInPlugin. Whoops
* A user-friendly error will be displayed before the game exits so that it's clear as to what's going wrong. Should prevent reports of crashing on game load now
Co-authored-by: Terkoiz <terkoiz@spt.dev>
Reviewed-on: SPT-AKI/Modules#75
Co-authored-by: Terkoiz <terkoiz@noreply.dev.sp-tarkov.com>
Co-committed-by: Terkoiz <terkoiz@noreply.dev.sp-tarkov.com>
By multiplying `moveSpeed` by `Time.deltaTime` in `BTRVehicle.Update()`, it prevents the BTR movement from desyncing, and possibly going faster or slower than expected.
Reviewed-on: SPT-AKI/Modules#73
Co-authored-by: Arys <arys@noreply.dev.sp-tarkov.com>
Co-committed-by: Arys <arys@noreply.dev.sp-tarkov.com>
- Before `Application.targetFrameRate` is used in the BTR code, set it to 60. Then set it back afterwards
- Remove an unnecessary error from BTRExtractPassengersPatch, not actually an error state
All credit goes to Ngst for figuring out that NVidia Reflex was causing the BTR issues
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: SPT-AKI/Modules#71
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Honestly this is just a shot in the dark hotfix. I've tested it and these changes still work fine for me.
Let me know if this fixes the BTR not working, Chomp
Reviewed-on: SPT-AKI/Modules#69
Co-authored-by: Arys <arys@noreply.dev.sp-tarkov.com>
Co-committed-by: Arys <arys@noreply.dev.sp-tarkov.com>
Todo:
* Make BTR spawn at random time during raid instead of at start
* ~~Fix BTR trader services not working for subsequent raids in Streets~~ Drakia provided me with a fix and it's included in this PR
TL;DR - It's ready for testing
Co-authored-by: Nympfonic <arys.steam@gmail.com>
Reviewed-on: SPT-AKI/Modules#68
Co-authored-by: Arys <arys@noreply.dev.sp-tarkov.com>
Co-committed-by: Arys <arys@noreply.dev.sp-tarkov.com>
Todo:
* Make BTR spawn at random time during raid instead of at the start
* Find out why some players receive error relating to `BTRBotAttachPatch` resulting BTR failing to initialise
Co-authored-by: Nympfonic <arys.steam@gmail.com>
Reviewed-on: SPT-AKI/Modules#67
Co-authored-by: Arys <arys@noreply.dev.sp-tarkov.com>
Co-committed-by: Arys <arys@noreply.dev.sp-tarkov.com>