-
Notifications
You must be signed in to change notification settings - Fork 506
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
BAPI - mapmanip submap noop handling #19523
Open
DreamySkrell
wants to merge
11
commits into
Aurorastation:master
Choose a base branch
from
DreamySkrell:2024-06-22--bapi-submaps-noop
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
BAPI - mapmanip submap noop handling #19523
DreamySkrell
wants to merge
11
commits into
Aurorastation:master
from
DreamySkrell:2024-06-22--bapi-submaps-noop
+459
−412
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!build_bapi |
!build_bapi |
…eamySkrell/Aurora.3 into 2024-06-22--bapi-submaps-noop
!build_bapi |
!review |
Arrow768
approved these changes
Jun 23, 2024
Llywelwyn
reviewed
Jun 23, 2024
Comment on lines
+49
to
+84
match (tile_src_area_is_noop, tile_src_turf_is_noop) { | ||
(true, true) => { | ||
// both area and turf are noop | ||
// append all atoms from src into dst | ||
// use dst turf, and dst area | ||
tile_dst.prefabs.append(&mut tile_src.prefabs); | ||
tile_dst.prefabs.push(tile_dst_turf); | ||
tile_dst.prefabs.push(tile_dst_area); | ||
} | ||
(true, false) => { | ||
// src tile has noop area | ||
// replace all dst atoms with src atoms | ||
// use src turf, and dst area | ||
tile_dst.prefabs = tile_src.prefabs; | ||
tile_dst.prefabs.push(tile_src_turf); | ||
tile_dst.prefabs.push(tile_dst_area); | ||
} | ||
(false, true) => { | ||
// src tile has noop turf | ||
// append all atoms from src into dst | ||
// use dst turf, and src area | ||
tile_dst.prefabs.append(&mut tile_src.prefabs); | ||
tile_dst.prefabs.push(tile_dst_turf); | ||
tile_dst.prefabs.push(tile_src_area); | ||
} | ||
(false, false) => { | ||
// src tile has neither noop area nor turf | ||
// the simplest case, just replace the whole dst tile with the src tile | ||
// use src turf, and src area | ||
tile_dst.prefabs = tile_src.prefabs; | ||
tile_dst.prefabs.push(tile_src_turf); | ||
tile_dst.prefabs.push(tile_src_area); | ||
// do note that in dmm file format | ||
// turf and area have to be the two last elements in a prefab | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let new_area = if tile_src_area_is_noop { tile_dst_area } else { tile_src_area };
let new_turf;
if tile_src_turf_is_noop {
new_turf = tile_dst_turf
tile_dst.prefabs.append(&mut tile_src.prefabs)
} else {
new_turf = tile_src_turf
tile_dst.prefabs = tile_src.prefabs
}
tile_dst.prefabs.push(new_turf);
tile_dst.prefabs.push(new_area);
something like this is functionally the same but a little cleaner than needing the comments imo
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
🗺️ Mapping - Horizon
The PR touches the Horizon map files.
Merge Conflict
Review Required
Sprites
Adds new or changes existing sprites.
Tools
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
changes:
both features are explained in forum thread https://forums.aurorastation.org/topic/20511-mapmanip-guide-submaps/
but basically: