Repository navigation
One more Map::Units function at 100%: UpdateSiegeTent - #473
Open
kotijekriv wants to merge 1 commit into
Open
kotijekriv wants to merge 1 commit into
kotijekriv wants to merge 1 commit into
Conversation
Units::UpdateSiegeTent, from Gynt's draft on sourcehold's reimpl/map-units-updatefunctions (his draft PR 204; the file's commits there: 609ef6d, the 69.44% import, then his 2fe31a8, 8d684a9 at 69.44%, 974c32f's clang-format, and c933f79, his PR 286 merged into that branch, which took this file's body from reimpl/Wilps-2026-10-18). It reads a true 100.0 / 100.0. The statements are his; what the text needed is where two of them stand. 1. The ULS_TRANSITIONING store stands in front of the `fixedRng & 2` test, as in the original (0x005307FA, the test at 0x00530803). The draft wrote it in both arms so that the type stays a branch, and the compiler then placed the merged store behind the test. Written once in front of the if, the type becomes a branch-free select (sbb) unless the arms hold more than the one store: so the state_2 store, behind the keep reads in the draft, is written in both arms behind the type store. The compiler merges the two copies into the one store behind the join (0x0053082C) and keeps the branches (0x0053080B / 0x00530816). 2. The names of this tree: field_0x3bc; the keep's entry as playerDataArray[1].buildingEntryInfos[BEIE_KEEP] (yEntry 0x0115F888 and xEntry 0x0115F884 are read in that order, hence the two locals); state_2's 6 as US_FIRE_WEAPONUnk (changeUnitType, 0x0053E6C0, copies state_2 into the new engine's state). 3. The `frame >= 4` test after `& 3` is never true, but the original compares and stores it (0x005307D1), so it stays, with a fixme comment; `(fixedRng + 1) & 3` in parentheses, `animationCycleNumber++`, const locals. Measured with real builds of the units stack's head 6e3de74062 (the headers this file includes are the same there as on main 0e4a83b; its one callee, calculatePreferredRelativeOrientation, is reimplemented in neither), the whole build list plus this file and its /GL line, BUILD_OK each: UpdateSiegeTent 100.0 raw / 100.0 normalised, no diff entry, 345 functions; none of the other 344 reads differently. The text before the review's text fixes (the two enum names, the comments, const locals) read the same. Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
One more function at 100%, with no header changes.
Units::UpdateSiegeTentis from gynt's units branchreimpl/map-units-updatefunctions(his draft #204; his #286, merged into that branch as c933f79, took thisfile's body from
reimpl/Wilps-2026-10-18), and the commit credits him as co-author.Units::UpdateSiegeTent/GLWhat got it to 100%. One store moved and one written twice:
ULS_TRANSITIONINGstore stands in front of thefixedRng & 2test, as in the original (0x005307FA). Thedraft wrote it in both arms, so the merged store landed behind the test.
sbb): so thestate_2store(
US_FIRE_WEAPONUnk) is written in both arms behind the type store. The compiler merges the two copies into onestore behind the join (0x0053082C) and keeps the original's branches (0x0053080B / 0x00530816).
frame >= 4test after& 3can never be true, but the original compares and stores it (0x005307D1): itstays, with a
fixme:comment.buildingEntryInfos[BEIE_KEEP]for the keep's entry (y is read before x, hence the two locals).field_0x3bchas no better name in this tree; in gynt's catapult, ballista and fire-ballista drafts it is set to-40 .. -200 and counted up before firing, so it is probably the siege engines' reload cooldown (reset here so a
new engine can fire at once).
Measured.
Stronghold Crusader.exe(3bb0a8c1…5387ac5a), both resolversets enabled locally (not committed), and sourcehold's reccmp with
--resolve-wrapped-calls --ignore-security-cookie./GLlist (main's plus the one line this commit adds), and with 0x004314E0 (theMapEditorLandscaping_GeneralButtonshandler) left out and its resolver off, as in main's baseline: 0 failed of 2,426 compile steps, 99.58 over 2,442 functions.UpdateSiegeTentreads 100.0 raw and normalised there too, with no diff entry. No main function reads differently: against main's own build (made at f489b72, 2,439 functions) the only other changes are main's since then, One more UI::MenuModals function at 100%: ProgressBarBox #467'sMenuModalRenderFunction_ProgressBarBoxand UI: the single-player game launch at 100% #466'sLaunchSinglePlayerGameUnkat 100.0 andConstructor_MenuModal_ProgressBarBoxat 100.0 (93.8 before One more UI::MenuModals function at 100%: ProgressBarBox #467); every other function reads exactly what it read before (unrounded 99.5790 raw and 99.5529 normalised, 2,326 functions at 100.0 raw; main 0e4a83b alone: 99.5788 and 99.5528 over 2,441, 2,325 at 100.0).includes is the same there as on main 0e4a83b, and its one callee,
calculatePreferredRelativeOrientation,is reimplemented in neither). With this file and its
/GLline:UpdateSiegeTent100.0% raw and normalised, nodiff entries, 345 functions, none of the other 344 reading differently from the build without it.
Checks:
openshc-pr-checkgives 0 ERROR and 1 CHECK:field_0x3bcis a placeholder name (see above).Other PRs
UpdateSiegeTent.cppand one more status hunk, at0x005307B0 (100.0% here against his 69.4%). Once this lands, his branch can take main's version.
of
cmake/compiler-flags-gl.txt, so whichever goes in second gets a small conflict there: keep the lines ofboth (reimpl/BuildingsState #234, Reimpl/units state #238, Reimpl/viewport render state #241, reimplement OpenSHC::Text::TextManager and OpenSHC::Text::UserTextHandler #265, Reimplement 3 UI::MenuItems functions from gynt's drafts (not yet 100%) #328 and Reimpl/TileMapState 100% batch 2 #396 conflict there too, but they already conflict with main). Reimplement 47 UnitsState functions at 100% and restyle 28 more #378,
Map::Units::UpdateLion at 100% #425, Reimplement 20 BuildingsState functions at 100% #377, Reimplement 88 Map::TileMapState functions at 100% #366 and Reimplement the remaining Map::Buildings Update* functions #297 merge cleanly. Checked with
git merge-treeagainst every open PR's head.🤖 Generated with Claude Code