winstxnhdw / lc-hax

A powerful, feature-rich and highly performant internal cheat for the co-op indie horror video game, Lethal Company.
77 stars 25 forks source link

[Bug]: Deposit Attack for Trigger Mod #396

Closed D1GQ closed 4 months ago

D1GQ commented 4 months ago

What happened?

The way you have it currently set up no matter where you're looking when you use the trigger mod it activates the deposit attack, this makes sense at first because there's nothing else to trigger, but sometimes people have mods where either enemies spawn at the company or someone's using control company and you can't possess because of deposit trigger. So this code right here simply just makes it work like every other object where you have to look at it.

Trigger Mod:

Remove:

if (HaxObjects.Instance?.DepositItemsDesk?.Object.Unfake() is DepositItemsDesk deposit) {
    deposit.AttackPlayersServerRpc();
    return;
}

Add:

foreach (RaycastHit raycastHit in camera.transform.SphereCastForward()) {
    Collider collider = raycastHit.collider;

    if (collider.TryGetComponent(out DepositItemsDesk deposit)) {  // New
        deposit.AttackPlayersServerRpc();                
    }
    // Rest of code
}

Current Commit Hash

none

Injector

If you selected "Others" above, please specify the injector you are using.

No response

Log output

No response

Acknowledgement

winstxnhdw commented 4 months ago

Good catch.

winstxnhdw commented 4 months ago

Fixed in latest.