winstxnhdw / lc-hax

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

Feature : build anywhere? #254

Closed xAstroBoy closed 5 months ago

xAstroBoy commented 5 months ago

I dont get why it got removed, i reverted the removal and is still working

winstxnhdw commented 5 months ago

See #236

xAstroBoy commented 5 months ago

Yeah but still works if you try to overlap multiple objects together

winstxnhdw commented 5 months ago

What does that mean?

xAstroBoy commented 5 months ago

What does that mean?

The patch fixed just you cannot build outside the ship, yet inside you can still put multiple stuff overlapped on themself, build everywhere should be renamed no build constraints, which still is similiar

winstxnhdw commented 5 months ago

Sure, I'll add it back in with a new name.

xAstroBoy commented 5 months ago

@winstxnhdw your nullcheck is not working, still breaks the build, just add if(foo != null) and is a easy fix..

winstxnhdw commented 5 months ago

no, i just used the wrong conditional like an idiot

winstxnhdw commented 5 months ago

Anyways, this is a very good time to reflect the use of IsNotNull. It used to be helpful at the start to handle fake nulls but now it has become a burden. It doesn't even provide type guard intellisense.

I think from here onwards, I'll prefer the following style.

        if (___placingObject.Unfake() is not PlaceableShipObject placingObject) return true;

But you are right, it really does look like this is the best way to write it here

    static bool Prefix(ref bool __result, ref bool ___CanConfirmPosition, ref PlaceableShipObject? ___placingObject) {
        if (___placingObject == null) return true;

        ___placingObject.AllowPlacementOnCounters = true;
        ___placingObject.AllowPlacementOnWalls = true;
        ___CanConfirmPosition = true;
        __result = Helper.LocalPlayer?.inTerminalMenu is false;

        return false;
    }