Skip to content

Translate functions related to unit creation and deletion#112

Merged
rajko-horvat merged 3 commits intorajko-horvat:masterfrom
VladimirMakeev:create-delete-unit
Nov 30, 2025
Merged

Translate functions related to unit creation and deletion#112
rajko-horvat merged 3 commits intorajko-horvat:masterfrom
VladimirMakeev:create-delete-unit

Conversation

@VladimirMakeev
Copy link
Contributor

Description of Changes

Functions F0_1866_0cf5 and F0_1866_0f10 that 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.

VladimirMakeev and others added 3 commits November 29, 2025 19:30
# 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

These 'if' statements can be combined.
@rajko-horvat rajko-horvat merged commit a9f8995 into rajko-horvat:master Nov 30, 2025
3 checks passed
@VladimirMakeev VladimirMakeev deleted the create-delete-unit branch November 30, 2025 21:40
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.

2 participants