Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Private field issues #121

Open
builder-main opened this issue Feb 24, 2024 · 0 comments
Open

New Private field issues #121

builder-main opened this issue Feb 24, 2024 · 0 comments

Comments

@builder-main
Copy link

builder-main commented Feb 24, 2024

Current Workaround

So it seems this is the workaround for now. Any direct access the new field breaks the rewritter.

_instanceNewField.DoesWhatYouWant(); //<- fails to rewrite
var myLocalNewField = _instanceNewField; // <- this gets correctly rewritten
myLocalNewField.DoesWhatYouWant(); //<- All good

Issue

I'm not sure if it's a regression and what would be its reason, but most of the time nowadays adding private fields fails as they are not rewritten correctly in every places. Example bellow.
Added
private CameraState _lastCamState;

One of the correctly rewritten part I believe
FastScriptReload.Scripts.Runtime.TemporaryNewFieldValues.ResolvePatchedObject<Indus.Client.Cameras.CinemachineBodyCollider__Patched_>(this)._lastCamState = state;

Some other places not rewritten
Gizmos.DrawWireSphere(_lastCamState.FinalPosition, BodyRadius);

It is the NewFieldsRewriter job to perform the rewrite now not sure why it skip some cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant