Translate functions related to unit creation and deletion#112
Merged
rajko-horvat merged 3 commits intorajko-horvat:masterfrom Nov 30, 2025
Merged
Translate functions related to unit creation and deletion#112rajko-horvat merged 3 commits intorajko-horvat:masterfrom
rajko-horvat merged 3 commits intorajko-horvat:masterfrom
Conversation
# Conflicts: # src/CivGame/Game/Segment_1866.cs
Refactor unit creation and deletion logic to improve readability and maintainability.
Comment on lines
+1509
to
+1517
| if (this.oCPU.ReadUInt16(this.oCPU.DS.Word, 0x20f4) == 0 && this.oCPU.ReadInt16(this.oCPU.DS.Word, 0x3936) == -1) | ||
| { | ||
| if (this.oParent.Var_d806_DebugFlag || playerID == this.oParent.CivState.HumanPlayerID || | ||
| (unit.VisibleByPlayer & (1 << this.oParent.CivState.HumanPlayerID)) != 0) | ||
| { | ||
| // Instruction address 0x1866:0x107d, size: 5 | ||
| this.oParent.MapManagement.F0_2aea_11d4_DrawCellWithUnit(unit.Position.X, unit.Position.Y); | ||
| } | ||
| } |
Check notice
Code scanning / CodeQL
Nested 'if' statements can be combined Note
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description of Changes
Functions
F0_1866_0cf5andF0_1866_0f10that are responsible for unit creation and deletion were renamed and translated.Rationale behind Changes
Code translation.
Suggested Testing Steps
Unit creation and deletion logic should work the same as before.