New Feature: Support Convert to another type.#2294
Open
frg2089 wants to merge 18 commits into
Open
Conversation
TaranDahl
requested changes
Jul 18, 2026
frg2089
marked this pull request as draft
July 18, 2026 17:38
|
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
frg2089
marked this pull request as ready for review
July 19, 2026 02:21
TaranDahl
reviewed
Jul 19, 2026
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
… space Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
Signed-off-by: 舰队的偶像-岛风酱! <frg2089@outlook.com>
TaranDahl
approved these changes
Jul 23, 2026
TaranDahl
left a comment
Contributor
There was a problem hiding this comment.
I see no other issues.
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.
Summary
Refactored the underlying type conversion system (
ConvertToType/ConvertToTypeEx) to support cross-type conversion between allTechnoTypeclasses exceptAircraftType. AddedUndeploysInto.ConvertToas a new conversion trigger onBuildingType.Changes
Core: rewritten conversion logic
ConvertToTypeand newConvertToTypeExnow handle cross-type conversion via creating a new object + destroying the old one, supportingInfantryType,UnitType, andBuildingType.AircraftTypeis only supported for same-type conversion (in-place type pointer update).PendingConvertTechnoTypeprocessed inOnEarlyUpdate— used when the source unit needs to finish its current animation frame before being destroyed.This improvement applies to all existing conversion paths (
Convert.Deploy,Convert.Undeploy,Convert.HumanToComputer,Convert.ComputerToHuman, etc.).New feature:
UndeploysInto.ConvertToBuildingTypetagUndeploysInto.ConvertTospecifies a targetTechnoType.UndeploysIntocreates the vehicle, it is converted to the target type on the next frame.Refactor
TransferMindControlOnDeployfromHooks.DeploysInto.cppintoTechnoExtas a reusable static method.Selection preservation
Documentation
Updated
New-or-Enhanced-Logics.mdwith documentation forUndeploysInto.ConvertTo, the expanded type support inConvert.Deploy/Convert.Undeploy, and a warning that cross-type conversion creates a new object and destroys the old one.Files Changed
src/Ext/Techno/Body.cppConvertToTypeExcross-type conversion,ConvertToTypesame-type fallback, property transfersrc/Ext/Techno/Body.hPendingConvertTechnoType, static method declarationssrc/Ext/Techno/Body.Update.cppsrc/Ext/Unit/Hooks.DeploysInto.cppTechnoExt, addUndeploysInto.ConvertTohooksrc/Ext/BuildingType/Body.h/.cppUndeploysInto.ConvertTotagdocs/New-or-Enhanced-Logics.md