Skip to content

Reimplement UpdateQuarryWorker and UpdateBaker from gynt's units branch (100%, one with OPENSHC_FUNCTION_VISIBILITY_UNITS on) - #561

Merged
gynt merged 5 commits into
sourcehold:mainfrom
kotijekriv:reimpl/units-A-getter2-100
Dec 4, 2026
Merged

gynt merged 5 commits into
sourcehold:mainfrom
kotijekriv:reimpl/units-A-getter2-100

Conversation

@kotijekriv

@kotijekriv kotijekriv commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Two more of the units from gynt's units branch reimpl/map-units-updatefunctions (his draft #204) that call BuildingsState::getBuildingResourceAmountByUid, which main defines inline since #536. The branch is on main 87e40b6, with main 4a2a6cb merged in. UpdateQuarryWorker reads 100.0% raw and normalised in the default build and with main's function-visibility option on, UpdateBaker with the option on and less in the default build (see the table). Each gets an entry in cmake/function-visibility.txt; one header field gets its type (Unit::field_0x410, below). Each unit commit cites gynt's commits on the file and credits him as co-author; the text work began on other development branches of ours, written with Claude Fable 5.2, and the unit commits keep that co-author line.

Function Address Before Default build Option on
Units::UpdateQuarryWorker 0x00550D70 gynt's draft 59.76% (d839367) 100.0% / 100.0% 100.0%
Units::UpdateBaker 0x00555880 gynt's draft 57.72% (aa0d801) 93.2% / 87.2% 100.0%

"Before" is gynt's own status number on the file (main's status file has 0.0%, Pending, for both). The default build's numbers are raw / normalised. UpdateBaker's status line carries the default build's raw number with the remark 100.0 with OPENSHC_FUNCTION_VISIBILITY_UNITS on, as main's UpdatePitchman, UpdateEngineer and UpdateDairyFarmer have.

Header change

  • Unit::field_0x410 (Unit.hpp, offset 0x410): byte to char, in a commit of its own in front of the units. gynt synced it to main in 55fa231, and main is merged in, so the PR's diff no longer shows it; the commit stays in the branch's history. The original tests it signed in UpdateQuarryWorker (mov cl, byte ptr [unit + 0x138895c] at 0x00551205, test cl, cl, jle at 0x0055120D). The other instructions of the game with that address are that function's two stores (0x00551212, 0x0055123E) and the compare with 0 at 0x00422497 in findQuarryPileThatIsCloseAndHasMostStone, the field's only user on main, which tests it with != 0 and reads 100.0% / 100.0% in this branch's small builds, option on and off, and in main's with the option on. The size and the name stay.

The entries

  • With the option on, every caller and callee joined by entries ends up in one group, each group is built as one wrapper unit that #includes its members (without /GL), and the members leave the /GL list. Every name but one is already a member of the group that holds hasUnitReachedDestination. The one is tracePathFromLadderExitSetDestination (100.0%, no calls of its own, on the /GL list): no .cpp on main calls it, so it joins the group (and leaves the /GL list with the option on) and no other function sees a body it did not see before or loses one. cmake/function-visibility-units.py makes 25 wrapper units holding 174 source files on this branch, 171 on main 06cdd81: the two units and that callee are the only new members.
  • The callee outside the group: behind the call of tracePathFromLadderExitSetDestination the original does not load the slot again (one load at 0x00550F92, used at 0x00550F98 and 0x00550FA3), so it saw that body. UpdateQuarryWorker is 0.9856 without it and 0.9986 with it.
  • Why UpdateQuarryWorker has an entry, though it reads 100.0% in the default build: with the option on its callees leave /GL with their group, so without the entry it would lose their bodies; the 0.5256 for the unit alone is the measure.
  • quick_diff, the unit with the callees of its entry in front of it. The rest to 1 is spelling in quick_diff's two streams (a negative byte or word immediate prints as 0xff / 0xffff on the original's side).
  • UpdateQuarryWorker: 0.5256 alone, 0.9986 with the 9 listed. Left out, getBuildingResourceAmountByUid 0.9959; IncrementAndOptionalUpdateAVValueRelated 0.9436; ConsiderHavingABreakNowUnk 0.9802; SetStateToFreetimeWalking 0.9714; ComputeGoodsProduced 0.9883; checkIfCitizenUnitIsAliveBasedOnState 0.79; hasUnitReachedDestination 0.9544; tracePathFromLadderExitSetDestination 0.9856; UpdateWorker_ConsiderTakingABreakUnk 0.9802.
  • UpdateBaker: 0.5688 alone, 0.9953 with the 14 listed. Left out, getBuildingResourceAmountByUid 0.9764; setupUnitSharingTileIDs 0.9929; standUpIfSeated 0.9923; sitDownIfStanding 0.9935; IncrementAndOptionalUpdateAVValueRelated 0.8231; ConsiderHavingABreakNowUnk 0.99; SetStateToFreetimeWalking 0.9682; CheckUnitProductionPaused 0.9369; ComputeGoodsProduced 0.9529; checkIfCitizenUnitIsAliveBasedOnState 0.9226; hasUnitReachedDestination 0.9442; setupUnitSharingCurrentTilePosition 0.9929; UpdateWorker_ConsiderTakingABreakUnk 0.99; commitUnitLocation 0.9929. Not named, leaving it out changes nothing: makeUnitStopWalkingByClearingPathProgressState.

Measured

Setup: the bundled MSVC1400-SP1 against the Steam Stronghold Crusader.exe (3bb0a8c1…5387ac5a), both resolver sets enabled locally (not committed: the data resolvers with tools/reimplementation-control/enable_reimplemented_data.py, the function resolver of every .cpp in the build with tools/reimplementation-helper/batch/enable_local_functions.py), and sourcehold's reccmp with --resolve-wrapped-calls --ignore-security-cookie. The builds are of main 06cdd81 and of this branch on it, before it was rebased onto 87e40b6. gynt's three header syncs in between (1fea2ce, c1b50c4, 87e40b6) add one line to the status file, add the TribeState and TribeStateShort enums and rename TreeStateEnum's values (TS_ to TSE_), which no .cpp names; no .cpp changes.

  • Full builds, option off, of main 06cdd81 and of this branch on it, each merged with our Reimplement UnitsState::prepareProjectileTarget at 100%, from gynt's text on main (one header line each in two files) #540 so that prepareProjectileTarget.cpp compiles, and leaving out resetTileAndClearMoat (it doesn't compile on main until Reimplement 67 Map::TileMapState functions (batch 2) #396), TransformAndRenderPercentage (on our list from before Reimplement 59 TextManager and UserTextHandler functions at 100% #509) and findBestAttackTileByPathCost (on our list from before 592a17d made it compile): 3,111 files on the branch and 3,109 on main, BUILD_OK, 3,129 and 3,127 functions compared. Only the two units read differently: main doesn't have them, and here UpdateQuarryWorker reads 100.0% / 100.0% and UpdateBaker 93.2% / 87.2%. The other 3,127 read the same, handleMenuItems and Constructor_Menu included: they go between two readings from one build to another with their files unchanged, and read 100.0% in both of these.
  • Small builds of this branch in both modes and of main 06cdd81 with the option on, from the same list (491 files on the branch, 489 on main: every /GL file, both units, every .cpp that names getBuildingResourceAmountByUid, findQuarryPileThatIsCloseAndHasMostStone.cpp (the user of Unit::field_0x410), the callees of these that read 100.0% down their call trees, every file of a function-visibility group that touches one of these, and IO/ResourceManager/paths.cpp, which the link needs): BUILD_OK and 0 failures in all three. Main's small build with the option off was not run; the full builds above compare that mode.
    • Option off (504 functions): UpdateQuarryWorker 100.0% / 100.0%, UpdateBaker 93.2% / 87.2%; the getter, tracePathFromLadderExitSetDestination and findQuarryPileThatIsCloseAndHasMostStone 100.0% / 100.0%.
    • Option on (504 functions): UpdateQuarryWorker and UpdateBaker 100.0% / 100.0%, and so do the getter, tracePathFromLadderExitSetDestination and findQuarryPileThatIsCloseAndHasMostStone. Against the same build of main (502 functions) only the two units read differently: main's build doesn't have them, and the other 502 read the same.
  • Text pass (after the changes above): the text before and after it was compared as object code, byte for byte, with the unit alone and with its entry's callees in front of it: the same. Each commit lists its edits.
  • Checks: the style checks (the maintainers' review asks and main's style_lint.py) and the status lines: nothing to fix automatically, no errors and 35 notes, all of the kinds below.
  • Not run in game.
  • Note: the small builds leave out resetTileAndClearMoat (it doesn't compile on main until Reimplement 67 Map::TileMapState functions (batch 2) #396), TransformAndRenderPercentage (on our list from before Reimplement 59 TextManager and UserTextHandler functions at 100% #509) and main's prepareProjectileTarget.cpp (main's header declares it void since d134c77 while the .cpp still returns int; our Reimplement UnitsState::prepareProjectileTarget at 100%, from gynt's text on main (one header line each in two files) #540 changes the .cpp). This PR doesn't touch them.

Against gynt's drafts

Each text was compared with gynt's as folded text (spelling, qualifiers and his local copy of the slot folded): every call with its arguments, every test and every store. UpdateQuarryWorker has the same 36 calls and 64 tests, UpdateBaker the same 55 calls and 72 tests. A BOOLEnum call's != 0 / == FALSE written as a truth test and tests turned round where arms are swapped are not listed. What differs:

  • Both: every access reads the unit through DAT_CurrentUnitSlotID::instance; his texts keep the slot in a local read at the top, and read the global itself behind some calls.
  • UpdateQuarryWorker: state 7 tests DAT_UnitHasBecomeIdle itself for the reset of the animation cycle and reads the idle local behind it (his reads the local first; nothing between the two reads writes the flag); substate > 6 is >= 7 and currentIndexInPathPlan > 7 is >= 8, the constants the original compares with; states 101 and 102 have their arms the other way round.
  • UpdateBaker: one else-if chain instead of blocks that return. The arms the other way round, by state: 1, the paused test (the paused baker's frame first); 2, the destination test (a destination found first, the exit to disappearing behind it); 7, the fetching state: the next stockpile's destination test (no path first, the way home; the removal behind it), the setWorkplaceBuildingEntryAsTarget test (the way home first, the removal behind it) and the bakery's destination test (found first, state 8; the removal behind it); 6, the delivery: the space test (space first), the next granary's access test (accessible first; his has the one that clears the load first), the next stockpile's access test (accessible first) and both setWorkplaceBuildingEntryAsTarget tests (the way home first, the removal behind it). The stores that send him home stand in each arm that reaches them (states 6 and 7), where his text has them once behind the tests.

Kept as they are

  • One ternary (UpdateQuarryWorker), with a comment on the line above: the original picks the speed without a branch (setge at 0x0055140A). The style-lint bot will list it.
  • (char) on Unit::engineerManningSiegeStateRef_checkType (UpdateBaker): the field holds the signed fade step and is a byte in the header (as in Reimplement UpdateCamel, UpdateLady, UpdateMother and UpdateFireEater from gynt's units branch, under /GL (100%) #515, Reimplement UpdateChild, UpdateWheatFarmer, UpdateCrossbowman, UpdateLadderman, UpdateTunneler and UpdateFireThrower from gynt's units branch, under /GL (100%) #516, Reimplement UpdateArabianArcher and UpdateCrusaderArcher from gynt's units branch, under /GL (100%) #518 and Reimplement UpdateTanner, UpdateArmorer, UpdatePoleTurner, UpdateFletcher, UpdateBlacksmith and UpdateWoodcutter from gynt's units branch, 100% with OPENSHC_FUNCTION_VISIBILITY_UNITS on #536).
  • (short) stores into targetID_OR_targetBuildingID, resourceToDeposit and workers[0], as main's unit functions write them.
  • BOOLEnum calls tested by truthiness, the rest compared with 0: buildingIsAccessible, canBuildingStoreTheAmount, getResourceCountThatCanBeDeposited and updateBuildingSignpostCounter return int; isDisappearingUnk, goToRallyPoint and killedFlagUnk are two-byte short fields; DAT_UnitHasBecomeIdle is an undefined4, compared with 0 as on main.
  • 102 in UpdateQuarryWorker (a state main's enums have no name for), and the generic names for 7, 101, 108 and 121, which UnitState_QuarryWorker does not have. 110 and 111 (US_DISAPPEAR, US_DEATH_01) are generic in both units.
  • UpdateBaker's 3, 4, 108, 109 and 121 have no name in UnitState_Baker, so they keep main's generic names (US_STATE_3Unk, US_RELOAD_WEAPONUnk, US_UNKNOWN_108, US_JESTER_ROAM_TO, US_UNKNOWN_121), which don't fit him: 3 is baking, 4 putting the flour into the oven and 109 the fade at the bakery door.
  • The locals at the top: the original reads them in front of the state tests (UpdateQuarryWorker 0x00550D7F to 0x00550D96, UpdateBaker 0x00555892). With UpdateQuarryWorker's owner or UpdateBaker's bakery read at its uses the code differs. Where the text reads a field again that a local already holds, the object code with the local there differs (each tried): owner in UpdateQuarryWorker's states 1, 6, 102 and 110, workplace in states 1 and 110, bakery in UpdateBaker's states 3 (twice), 4, 109 and 110.
  • UpdateBaker's next stockpile: when setDestinationForUnit succeeds the baker is removed (0x00555D24, 0x00555D55), when it fails he goes to the bakery: the original has it, and the text has a comment there. When setWorkplaceBuildingEntryAsTarget fails after he took the flour, the state stays (0x00555DCD).
  • UpdateQuarryWorker's state 6 tests the ox's load with < 0 (0x00551328) and then takes one, so a load of 0 goes to -1: the original has it.
  • The going-home stores twice in UpdateBaker's states 6 (the delivery) and 7 (fetching), with a comment above each: with the stores once behind the tests (gynt's form) in either state, or one test of setWorkplaceBuildingEntryAsTarget behind both paths in state 6, the object code differs.
  • Other notes of the checks: Ghidra's placeholder field names, the wrong-struct hint for field_0x58 (Unit::field_0x58 is a short, the hint comes from SoundEffectsHelperData1), casts on fields we list here, and the header change (above).

Names on main these files show (follow-ups, not changed here)

  • UnitState_QuarryWorker: in this function 2 (USQW_AWAITING_STORE_SPACE) is picking up a stone at the pile, 3 (USQW_TAKING_GOODS_TO_STORE) walking to the stockpile, 6 (USQW_WAITING_6) taking a stone off the ox's load; 7 is the resting state (unitTypeSpecificRestingState), and 5 (USQW_RESTING) does not occur; 101 is walking to the pile or back, 102 carrying a stone to the stockpile.
  • UnitStateUnion has no member for UnitState_BakerShort. UnitState_Baker has no names for 3 (baking), 4 (putting the flour into the oven) and 109 (the fade in or out at the bakery door, behind which he goes to cachedState).
  • Unit::field_0x410 is set to 8 whenever the quarry worker leaves the pile without a stone (none left, the quarry not accessible, or no path to it) and counts down with each stone he picks up.
  • Frame tables of UnitPropertiesDefinedData by the state that reads them: field_0x4ad4 (quarry worker, resting), field_0x41bc (melee), field_0x4ab0 (death); field_0x5150, field_0x5160, field_0x51ec, field_0x52b4, field_0x5324, field_0x53dc (baker, idle substates 100, 101 and 106 to 109), field_0x5174 (production paused).

Left out

  • UpdateBrewer, which calls the same getter, is left for a PR of its own.

Other PRs

🤖 Generated with Claude Code

Unit.hpp, offset 0x410: `byte` -> `char`, the size and the name stay. The original tests the field signed in
UpdateQuarryWorker: mov cl, byte ptr [unit + 0x138895c] at 0x00551205, test cl, cl, jle at 0x0055120D. The other
instructions of the game with that address are that function's two stores (0x00551212, 0x0055123E) and the compare
with 0 at 0x00422497 in findQuarryPileThatIsCloseAndHasMostStone, the field's only user on main, which tests it with
`!= 0` and reads the same: 100.0 / 100.0 in the small builds of this branch on main 06cdd81, with
OPENSHC_FUNCTION_VISIBILITY_UNITS on and off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Units::UpdateQuarryWorker, from Gynt's draft on sourcehold's reimpl/map-units-updatefunctions (his draft PR 204; his
commits on the file: 99f9b5b at 53.35%, d839367 at 59.76%, then 974c32f's clang-format), through the forms
on our development branches. It reads 100.0 / 100.0 in the default build; with OPENSHC_FUNCTION_VISIBILITY_UNITS on,
its entry in cmake/function-visibility.txt and getBuildingResourceAmountByUid defined inline in its own file (on
main since PR 536) it reads 100.0 / 100.0 (reccmp raw / normalised). Compared with his draft as folded text
(spelling, qualifiers and the local copy of the slot folded): the 36 calls have the same arguments, and the 64 tests
and the stores are the same but for the list below (a BOOLEnum call's `!= 0` / `== FALSE` written as a truth test,
and tests turned round where the arms are swapped, are not listed).

- Every access reads the unit through DAT_CurrentUnitSlotID::instance; the draft keeps the slot in a local read at
  the top, and reads the global itself behind some calls. quick_diff with the entry's callees in front reads 0.9932
  with the local (without the callee below) and 0.9973 without it and with that callee.
- State 1: behind tracePathFromLadderExitSetDestination the original does not load the slot again (one load at
  0x00550F92, used at 0x00550F98 and 0x00550FA3), so it saw that body: the entry names it. No .cpp on main calls it.
- State 7: the reset of the animation cycle tests DAT_UnitHasBecomeIdle itself, and the idle local is read behind
  it; the draft reads the local first and tests it. The test stands in front of the gfxNumber store in the original
  (0x0055105F, 0x00551061).
- `substate > 6` is `>= 7` and `currentIndexInPathPlan > 7` is `>= 8`, the constants the original compares with
  (0x005510A9, 0x00551402).
- States 101 and 102 have the arm with a stone first, and state 102 the arm with space in the stockpile.

Text pass (after the changes above), the same object code before and after, the unit alone and with its entry's
callees in front: states by UnitState_QuarryWorker's names (state.quarryWorker) where it has one, resources[4] as
RT_STONE, hex constants as decimal, the file-scope using lines gone, the (char) casts on the fade countdown, the
frame tables and field_0x410 dropped (char in the headers), ++ / -- for the steps of one, the BOOLEnum calls tested
by truthiness, const on the locals, a why above the ternary and above the three locals at the top, state comments
that say what the state does.

Measured with real builds (bundled MSVC1400-SP1, function and data resolvers on locally, reccmp raw / normalised),
small builds of this branch on main 06cdd81 (491 files, 504 functions: every /GL file, both units, every .cpp
that names getBuildingResourceAmountByUid, findQuarryPileThatIsCloseAndHasMostStone (field_0x410's user), the
callees of these that read 100.0 down their call trees, IO/ResourceManager/paths.cpp for the link, and every file of
a function-visibility group that touches one of these), with OPENSHC_FUNCTION_VISIBILITY_UNITS on and off, 0
failures. On and off: 100.0 / 100.0. The text was measured before on an older base (small and full builds, both
modes, the same readings); on main 06cdd81 its object code is the same, bytes and relocations, alone and with the
entry's callees in front.

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…N_VISIBILITY_UNITS on

Units::UpdateBaker, from Gynt's draft on sourcehold's reimpl/map-units-updatefunctions (his draft PR 204; his
commits on the file: 159da06 at 51.69%, aa0d801 at 57.72%, then 974c32f's clang-format), through the forms
on our development branches. With OPENSHC_FUNCTION_VISIBILITY_UNITS on, its entry in cmake/function-visibility.txt
and getBuildingResourceAmountByUid defined inline in its own file (on main since PR 536) it reads 100.0 / 100.0
(reccmp raw / normalised). Compared with his draft as folded text (spelling, qualifiers and the local copy of the
slot folded): the 55 calls have the same arguments, and the 72 tests and the stores are the same but for the list
below (a BOOLEnum call's `!= 0` / `== FALSE` written as a truth test, and tests turned round where the arms are
swapped, are not listed).

- Every access reads the unit through DAT_CurrentUnitSlotID::instance; the draft keeps the slot in a local read at
  the top, and reads the global itself behind some calls.
- The states are one if / else-if / else chain whose arms fall out; with a return closing each state the match is
  lost (checked on this text: the object code differs with the entry's callees in front).
- Arms the other way round than in the draft, by state: 1 (the paused baker's frame first); 2 (a destination found
  first, the exit to disappearing behind it); 7, the fetching state (no way to the next stockpile first, the removal
  behind it; the way home first, the removal behind it; the way to the bakery first, the removal behind it); 6, the
  delivery (space in the granary first; the next granary reachable first; the next stockpile reachable first; the
  way home first, the removal behind it, in both arms). State 8, carrying flour to the bakery, has the draft's arms.
- The stores that send him home stand in each arm that reaches them, where the draft has them once behind the tests:
  state 2, substate -1, seated 0 and destinationNeeded in state 6, state 2 and destinationNeeded in state 7. With
  the draft's form in state 7 or in state 6, or one setWorkplaceBuildingEntryAsTarget test behind both paths in
  state 6, the object code differs (each tried).

Text pass (after the changes above), the same object code before and after, the unit alone and with its entry's
callees in front: states by UnitState_Baker's names where it has one (through state.generic, the union has no member
for it), hex constants as decimal, the file-scope using lines gone, the (char) casts on the fade countdown and the
frame tables dropped (char in the headers), engineerManningSiegeStateRef_checkType set to -2, ++ / -- for the steps
of one, the BOOLEnum calls tested by truthiness, const on the locals, a local of its own for the next stockpile, a
return that falls out anyway dropped, whys above the local at the top and above the repeated stores (in states 6 and
7).

Measured with real builds (bundled MSVC1400-SP1, function and data resolvers on locally, reccmp raw / normalised),
small builds of this branch on main 06cdd81 (491 files, 504 functions: every /GL file, both units, every .cpp
that names getBuildingResourceAmountByUid, findQuarryPileThatIsCloseAndHasMostStone (field_0x410's user), the
callees of these that read 100.0 down their call trees, IO/ResourceManager/paths.cpp for the link, and every file of
a function-visibility group that touches one of these), with OPENSHC_FUNCTION_VISIBILITY_UNITS on and off, 0
failures. On: 100.0 / 100.0. Off: 93.2 / 87.2. The status line carries the default build's raw number. The text was
measured before on an older base (small and full builds, both modes, the same readings); on main 06cdd81 its
object code is the same, bytes and relocations, alone and with the entry's callees in front.

Co-authored-by: Gynt <gynt@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ateBaker

Both need the bodies of the callees below in the unit they are compiled with; each entry names them at the unit's
address, the callees in address order. Every name but one is already a member of the group that holds
hasUnitReachedDestination. The one is tracePathFromLadderExitSetDestination (100.0%, no calls of its own, on the /GL
list): no .cpp on main calls it, so it joins the group (and leaves the /GL list with the option on) and no other
function sees a body it did not see before or loses one. The generator makes 25 wrapper units holding 174 source
files (25 and 171 on main 06cdd81): the two units and that callee are the only new members.

Measured with quick_diff, the unit compiled with the callee files in front of it (the getter inline) against the
unit alone. The rest to 1 is spelling in quick_diff's two streams (a negative byte or word immediate prints as 0xff
/ 0xffff on the original's side).
- UpdateQuarryWorker: 0.5256 alone, 0.9986 with the 9 listed. Left out, getBuildingResourceAmountByUid 0.9959;
  IncrementAndOptionalUpdateAVValueRelated 0.9436; ConsiderHavingABreakNowUnk 0.9802; SetStateToFreetimeWalking
  0.9714; ComputeGoodsProduced 0.9883; checkIfCitizenUnitIsAliveBasedOnState 0.79; hasUnitReachedDestination 0.9544;
  tracePathFromLadderExitSetDestination 0.9856; UpdateWorker_ConsiderTakingABreakUnk 0.9802.
- UpdateBaker: 0.5688 alone, 0.9953 with the 14 listed. Left out, getBuildingResourceAmountByUid 0.9764;
  setupUnitSharingTileIDs 0.9929; standUpIfSeated 0.9923; sitDownIfStanding 0.9935;
  IncrementAndOptionalUpdateAVValueRelated 0.8231; ConsiderHavingABreakNowUnk 0.99; SetStateToFreetimeWalking
  0.9682; CheckUnitProductionPaused 0.9369; ComputeGoodsProduced 0.9529; checkIfCitizenUnitIsAliveBasedOnState
  0.9226; hasUnitReachedDestination 0.9442; setupUnitSharingCurrentTilePosition 0.9929;
  UpdateWorker_ConsiderTakingABreakUnk 0.99; commitUnitLocation 0.9929. Not named, leaving it out changes nothing:
  makeUnitStopWalkingByClearingPathProgressState.

Real builds: the small builds of the unit commits. With the option on the two units read 100.0 / 100.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the declaration/type change This requires changes to the generated/exported types or definitions. label Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

Style guide reading (advisory, posted once)

1 possible deviation(s) from REIMPLEMENTATION_STYLE_GUIDE.md across 1 of the 2 reimplemented .cpp file(s) in this PR.

The match comes first. Where the ugly form is what matched, it stays -- that is the guide's own overriding rule, and rule 21 asks for a one-line comment saying what was measured so the next reader does not retry it. This report is posted once, when the PR opens, and is not repeated on later pushes.

rule what it asks hits
23 Prefer if-else over ternary 1
Where

Rule 23 — Prefer if-else over ternary

  • src/OpenSHC/Map/Units/UpdateQuarryWorker.cpp:284 — ternary; the guide prefers extending the if-else chain

gynt added a commit that referenced this pull request Dec 4, 2026
Main now has Unit::field_0x410 as a char (gynt's 55fa231), the same change as this branch's header commit, so the
merge is clean and the PR no longer changes Unit.hpp.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot removed the declaration/type change This requires changes to the generated/exported types or definitions. label Dec 4, 2026
@gynt
gynt added this pull request to the merge queue Dec 4, 2026
Merged via the queue into sourcehold:main with commit c5de30d Dec 4, 2026
4 checks passed
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