mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -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:
parent
a69eaabe35
commit
2ebabeffc9
@ -51,6 +51,8 @@ namespace Aki.Custom.BTR
|
|||||||
|
|
||||||
private MethodInfo _updateTaxiPriceMethod;
|
private MethodInfo _updateTaxiPriceMethod;
|
||||||
|
|
||||||
|
private float originalDamageCoeff;
|
||||||
|
|
||||||
BTRManager()
|
BTRManager()
|
||||||
{
|
{
|
||||||
Type btrControllerType = typeof(BTRControllerClass);
|
Type btrControllerType = typeof(BTRControllerClass);
|
||||||
@ -115,6 +117,20 @@ namespace Aki.Custom.BTR
|
|||||||
{
|
{
|
||||||
btrServerSide.RightSlot1State = 1;
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user