0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 02:10:45 -05:00

Made Player invincible while in BTR so Border snipers dont kill you while being protected by the BTR

This commit is contained in:
Kaeno 2024-02-05 06:42:59 +00:00
parent a69eaabe35
commit 2ebabeffc9

View File

@ -51,6 +51,8 @@ namespace Aki.Custom.BTR
private MethodInfo _updateTaxiPriceMethod;
private float originalDamageCoeff;
BTRManager()
{
Type btrControllerType = typeof(BTRControllerClass);
@ -115,6 +117,20 @@ namespace Aki.Custom.BTR
{
btrServerSide.RightSlot1State = 1;
}
}
// If the player is going into the BTR, store their damage coefficient
// and set it to 0, so they don't die while inside the BTR
if (interactPacket.InteractionType == EInteractionType.GoIn)
{
originalDamageCoeff = gameWorld.MainPlayer.ActiveHealthController.DamageCoeff;
gameWorld.MainPlayer.ActiveHealthController.SetDamageCoeff(0f);
}
// Otherwise restore the damage coefficient
else if (interactPacket.InteractionType == EInteractionType.GoOut)
{
gameWorld.MainPlayer.ActiveHealthController.SetDamageCoeff(originalDamageCoeff);
}
}