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

UI: Prevent recursive aliases from being resolved. Fixes bitburner-official#630 #741

Merged
merged 4 commits into from
Aug 28, 2023

Conversation

ficocelliguy
Copy link
Contributor

@ficocelliguy ficocelliguy commented Aug 21, 2023

Refactor alias processing: when resolving an alias, look at the tracked list of previously-processed aliases that led to the current one, and do not resolve any aliaii aliases already present in it. This ensures there are no loops in the alias reference tree in a given command, and replaces the current only-one-alias-lookback solution.

closes #630

@ficocelliguy ficocelliguy marked this pull request as draft August 22, 2023 14:05
@ficocelliguy ficocelliguy marked this pull request as ready for review August 22, 2023 14:12
@Snarling
Copy link
Collaborator

Snarling commented Aug 26, 2023

Why the max depth check? I think the origin of that was just to prevent recursive replacements, but if you're already preventing recursive replacements then aliases should just continue to replace until there are no more non-recursive replacements to make. e.g. if a=b, b=c, c=d [...] y=z, then a should be replaced with z, it shouldn't randomly stop replacing aliases 10 levels deep.

@ficocelliguy
Copy link
Contributor Author

ficocelliguy commented Aug 28, 2023

I had left in the max depth as a bit of a failsafe (and in case it was an existing feature). I have removed it and updated the unit tests accordingly.

@Snarling Snarling merged commit 9323557 into bitburner-official:dev Aug 28, 2023
5 checks passed
@ficocelliguy ficocelliguy deleted the alias_recursion_fix branch August 28, 2023 19:11
G4mingJon4s pushed a commit to G4mingJon4s/bitburner-src that referenced this pull request Mar 23, 2024
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

Successfully merging this pull request may close these issues.

Change alias to not substitute the same alias recursively
2 participants