Skip to content

Commit

Permalink
Update observed controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
Lacyway committed Oct 19, 2024
1 parent 7092556 commit 92c298d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ namespace Fika.Core.Coop.ObservedClasses
{
internal class CoopObservedEmptyHandsController : EFT.Player.EmptyHandsController
{
public CoopPlayer coopPlayer;

private void Awake()
{
coopPlayer = GetComponent<CoopPlayer>();
}

public static CoopObservedEmptyHandsController Create(CoopPlayer player)
{
return smethod_6<CoopObservedEmptyHandsController>(player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public WeaponPrefab WeaponPrefab
}
}

public CoopPlayer coopPlayer;
private CoopPlayer coopPlayer;
private bool triggerPressed = false;
private bool needsReset = false;
private float lastFireTime = 0f;
Expand Down Expand Up @@ -89,11 +89,6 @@ private BaseAnimationOperation Flare1()
return new ObservedFlareOperation(this);
}

protected void Awake()
{
coopPlayer = GetComponent<CoopPlayer>();
}

protected void Start()
{
_objectInHandsAnimator.SetAiming(false);
Expand All @@ -107,7 +102,9 @@ protected void Start()

public static CoopObservedFirearmController Create(CoopPlayer player, Weapon weapon)
{
return smethod_6<CoopObservedFirearmController>(player, weapon);
CoopObservedFirearmController controller = smethod_6<CoopObservedFirearmController>(player, weapon);
controller.coopPlayer = player;
return controller;
}

public override void ManualUpdate(float deltaTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@ namespace Fika.Core.Coop.ObservedClasses
{
internal class CoopObservedGrenadeController : Player.GrenadeHandsController
{
public CoopPlayer coopPlayer;

private void Awake()
{
coopPlayer = GetComponent<CoopPlayer>();
}
private CoopPlayer coopPlayer;

public static CoopObservedGrenadeController Create(CoopPlayer player, GrenadeClass item)
{
return smethod_9<CoopObservedGrenadeController>(player, item);
CoopObservedGrenadeController controller = smethod_9<CoopObservedGrenadeController>(player, item);
controller.coopPlayer = player;
return controller;
}

public override Dictionary<Type, OperationFactoryDelegate> GetOperationFactoryDelegates()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ namespace Fika.Core.Coop.ObservedClasses
{
internal class CoopObservedKnifeController : EFT.Player.KnifeController
{
public CoopPlayer coopPlayer;

private void Awake()
{
coopPlayer = GetComponent<CoopPlayer>();
}
private CoopPlayer coopPlayer;

public static CoopObservedKnifeController Create(CoopPlayer player, KnifeComponent item)
{
return smethod_9<CoopObservedKnifeController>(player, item);
CoopObservedKnifeController controller = smethod_9<CoopObservedKnifeController>(player, item);
controller.coopPlayer = player;
return controller;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ namespace Fika.Core.Coop.ObservedClasses
{
internal class CoopObservedMedsController : EFT.Player.MedsController
{
public CoopPlayer coopPlayer;

private void Awake()
{
coopPlayer = GetComponent<CoopPlayer>();
}
private CoopPlayer coopPlayer;

public static CoopObservedMedsController Create(CoopPlayer player, Item item, EBodyPart bodyPart, float amount, int animationVariant)
{
return smethod_6<CoopObservedMedsController>(player, item, bodyPart, amount, animationVariant);
CoopObservedMedsController controller = smethod_6<CoopObservedMedsController>(player, item, bodyPart, amount, animationVariant);
controller.coopPlayer = player;
return controller;
}

public override bool CanChangeCompassState(bool newState)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ namespace Fika.Core.Coop.ObservedClasses
/// </summary>
internal class CoopObservedQuickGrenadeController : EFT.Player.QuickGrenadeThrowHandsController
{
public CoopPlayer coopPlayer;

private void Awake()
{
coopPlayer = GetComponent<CoopPlayer>();
}

public static CoopObservedQuickGrenadeController Create(CoopPlayer player, GrenadeClass item)
{
return smethod_9<CoopObservedQuickGrenadeController>(player, item);
Expand Down

0 comments on commit 92c298d

Please sign in to comment.