From 87b81b8866169d56eb0a6a98202fbe00f78112f7 Mon Sep 17 00:00:00 2001 From: Noble_Fish <1065703286@qq.com> Date: Thu, 16 Jul 2026 21:56:06 +0800 Subject: [PATCH 1/7] initial --- src/Ext/Techno/Hooks.Misc.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/Ext/Techno/Hooks.Misc.cpp b/src/Ext/Techno/Hooks.Misc.cpp index ce18ec3346..0ceed5fd3c 100644 --- a/src/Ext/Techno/Hooks.Misc.cpp +++ b/src/Ext/Techno/Hooks.Misc.cpp @@ -95,20 +95,24 @@ DEFINE_HOOK(0x6B72FE, SpawnerManagerClass_AI_MissileCheck, 0x9) ? NoSpawn : SpawnMissile; } -DEFINE_HOOK_AGAIN(0x6B73BE, SpawnManagerClass_AI_SpawnTimer, 0x6) -DEFINE_HOOK(0x6B73AD, SpawnManagerClass_AI_SpawnTimer, 0x5) +DEFINE_HOOK_AGAIN(0x6B73A8, SpawnManagerClass_AI_SpawnTimer, 0x5) +DEFINE_HOOK(0x6B73B9, SpawnManagerClass_AI_SpawnTimer, 0x5) { - GET(SpawnManagerClass* const, pThis, ESI); + GET(SpawnManagerClass*, pThis, ESI); + int delay = pThis->Owner->GetTechnoType()->MissileSpawn ? 9 : 20; if (auto const pOwner = pThis->Owner) { - auto const pTypeExt = TechnoExt::ExtMap.Find(pOwner)->TypeExtData; - - if (pTypeExt->Spawner_DelayFrames.isset()) - R->ECX(pTypeExt->Spawner_DelayFrames.Get()); + auto const pExt = TechnoExt::ExtMap.Find(pOwner); + if (pExt && pExt->TypeExtData) + { + auto const pTypeExt = pExt->TypeExtData; + if (pTypeExt->Spawner_DelayFrames.isset()) + delay = pTypeExt->Spawner_DelayFrames.Get(); + } } - - return 0; + pThis->SpawnTimer.Start(delay); + return 0x6B73C4; } DEFINE_HOOK_AGAIN(0x6B769F, SpawnManagerClass_AI_InitDestination, 0x7) From d8500787f509191d1f44bb027b4199817fc6b676 Mon Sep 17 00:00:00 2001 From: Noble_Fish <1065703286@qq.com> Date: Thu, 16 Jul 2026 23:44:34 +0800 Subject: [PATCH 2/7] Principle of minimizing changes --- src/Ext/Techno/Hooks.Misc.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Ext/Techno/Hooks.Misc.cpp b/src/Ext/Techno/Hooks.Misc.cpp index 0ceed5fd3c..bed6cf9737 100644 --- a/src/Ext/Techno/Hooks.Misc.cpp +++ b/src/Ext/Techno/Hooks.Misc.cpp @@ -98,21 +98,21 @@ DEFINE_HOOK(0x6B72FE, SpawnerManagerClass_AI_MissileCheck, 0x9) DEFINE_HOOK_AGAIN(0x6B73A8, SpawnManagerClass_AI_SpawnTimer, 0x5) DEFINE_HOOK(0x6B73B9, SpawnManagerClass_AI_SpawnTimer, 0x5) { - GET(SpawnManagerClass*, pThis, ESI); + GET(SpawnManagerClass* const, pThis, ESI); - int delay = pThis->Owner->GetTechnoType()->MissileSpawn ? 9 : 20; if (auto const pOwner = pThis->Owner) { - auto const pExt = TechnoExt::ExtMap.Find(pOwner); - if (pExt && pExt->TypeExtData) + auto const pTypeExt = TechnoExt::ExtMap.Find(pOwner)->TypeExtData; + + if (pTypeExt->Spawner_DelayFrames.isset()) { - auto const pTypeExt = pExt->TypeExtData; - if (pTypeExt->Spawner_DelayFrames.isset()) - delay = pTypeExt->Spawner_DelayFrames.Get(); + pThis->SpawnTimer.Start(pTypeExt->Spawner_DelayFrames.Get()); + return 0x6B73C4; } } - pThis->SpawnTimer.Start(delay); - return 0x6B73C4; + + R->ECX(pThis->Owner->GetTechnoType()->MissileSpawn ? 9 : 20); + return 0; } DEFINE_HOOK_AGAIN(0x6B769F, SpawnManagerClass_AI_InitDestination, 0x7) From 87d7867d362032435916acea025dbe8f9a534f9b Mon Sep 17 00:00:00 2001 From: Noble_Fish <1065703286@qq.com> Date: Thu, 16 Jul 2026 23:57:10 +0800 Subject: [PATCH 3/7] update --- src/Ext/Techno/Hooks.Misc.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Ext/Techno/Hooks.Misc.cpp b/src/Ext/Techno/Hooks.Misc.cpp index bed6cf9737..53e6fb99d3 100644 --- a/src/Ext/Techno/Hooks.Misc.cpp +++ b/src/Ext/Techno/Hooks.Misc.cpp @@ -109,9 +109,12 @@ DEFINE_HOOK(0x6B73B9, SpawnManagerClass_AI_SpawnTimer, 0x5) pThis->SpawnTimer.Start(pTypeExt->Spawner_DelayFrames.Get()); return 0x6B73C4; } + + R->ECX(pOwner->GetTechnoType()->MissileSpawn ? 9 : 20); + return 0; } - R->ECX(pThis->Owner->GetTechnoType()->MissileSpawn ? 9 : 20); + R->ECX(20); return 0; } From 1c1aae8d55563a72e4091c0b02d3d0dbc421e098 Mon Sep 17 00:00:00 2001 From: Noble_Fish <1065703286@qq.com> Date: Fri, 17 Jul 2026 00:06:29 +0800 Subject: [PATCH 4/7] [doc] Changelog & CREDITS --- CREDITS.md | 1 + docs/Whats-New.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CREDITS.md b/CREDITS.md index e49ef09d14..2bb95ecbcd 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -699,6 +699,7 @@ This page lists all the individual contributions to the project by their author. - Disable the credits indicator smooth transition - Add `selling`, `undeploying` and `harvesting` conditions to `DiscardOn` - `ZAdjust` for Projectiles + - Fix the bug that `MissileSpawn=true` causes the spawnee launcher to crash immediately when attacking - **Ollerus**: - Build limit group enhancement - Customizable rocker amplitude diff --git a/docs/Whats-New.md b/docs/Whats-New.md index df60214ffe..9f1a09161f 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -735,6 +735,7 @@ HideShakeEffects=false ; boolean - Fixed a bug where stationary vehicles would also block movement caused by external factors (by Noble_Fish) - Fixed `src/Interop/Version.cpp` not being compiled into the project (by Chang_zhi) - Fixed the issue that `NoQueueUpToEnter` will clear passenger's planning tokens when entered transport (by NetsuNegi) +- Fixed the bug that `MissileSpawn=true` causes the spawnee launcher to crash immediately when attacking (by Noble_Fish) #### Fixes / interactions with other extensions: - Taking over Ares' AlphaImage respawn logic to reduce lags from it (by NetsuNegi) From cc58341bf18f2b1f031ece5e8a27f835b30d989b Mon Sep 17 00:00:00 2001 From: Noble_Fish <1065703286@qq.com> Date: Fri, 17 Jul 2026 00:44:52 +0800 Subject: [PATCH 5/7] Correct the documentation description of spawn delay in #622 --- docs/New-or-Enhanced-Logics.md | 2 +- docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index 9020bd2883..fbc5520c39 100644 --- a/docs/New-or-Enhanced-Logics.md +++ b/docs/New-or-Enhanced-Logics.md @@ -1441,7 +1441,7 @@ AutoTargetAI.NoThreatBuildings=true ; boolean - If `Spawner.LimitRange` is set, the spawned units will abort their pursuit if the enemy is out of the range of the largest weapon `Range` of a `Spawner=true` weapon of the spawner. - `Spawner.ExtraLimitRange` adds extra pursuit range on top of the weapon range. -- `Spawner.DelayFrames` can be used to set the minimum number of game frames in between each spawn ejecting from the spawner. By default this is 9 frames for missiles and 20 for everything else. +- `Spawner.DelayFrames` can be used to set the minimum number of game frames in between each spawn ejecting from the spawner. By default this is 10 frames for launchers with `MissileSpawn=true` and 20 for everything else. - If `Spawner.AttackImmediately` is set to true, spawned aircraft will assume attack mission immediately after being spawned instead of waiting for the remaining aircraft to spawn first. - `Spawner.UseTurretFacing`, if set, makes spawned aircraft face the same way as turret does upon being created if the spawner has a turret. - `Spawner.RecycleRange` defines the range (in cell) that the spawned is considered close enough to the spawner to be recycled. diff --git a/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po b/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po index 4c29501cb5..0b8e2939af 100644 --- a/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po +++ b/docs/locale/zh_CN/LC_MESSAGES/New-or-Enhanced-Logics.po @@ -3518,8 +3518,9 @@ msgstr "`Spawner.ExtraLimitRange` 是追击范围相对于武器射程进行调 msgid "" "`Spawner.DelayFrames` can be used to set the minimum number of game " "frames in between each spawn ejecting from the spawner. By default this " -"is 9 frames for missiles and 20 for everything else." -msgstr "`Spawner.DelayFrames` 可用于设置每次从子机发射器中生成单位的最小游戏帧数。对于导弹默认是 9 帧,其他默认是 20 帧。" +"is 10 frames for launchers with `MissileSpawn=true` and 20 for everything" +" else." +msgstr "`Spawner.DelayFrames` 可用于设置每次从子机发射器中生成单位的最小游戏帧数。对于 `MissileSpawn=true` 的发射车默认是 10 帧,其他默认是 20 帧。" msgid "" "If `Spawner.AttackImmediately` is set to true, spawned aircraft will " From 0e01b57c8eb5faad19d36fc88827b3a0795e2256 Mon Sep 17 00:00:00 2001 From: Noble_Fish <1065703286@qq.com> Date: Fri, 17 Jul 2026 07:34:46 +0800 Subject: [PATCH 6/7] optimize --- src/Ext/Techno/Hooks.Misc.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Ext/Techno/Hooks.Misc.cpp b/src/Ext/Techno/Hooks.Misc.cpp index 53e6fb99d3..334f2a8890 100644 --- a/src/Ext/Techno/Hooks.Misc.cpp +++ b/src/Ext/Techno/Hooks.Misc.cpp @@ -100,6 +100,7 @@ DEFINE_HOOK(0x6B73B9, SpawnManagerClass_AI_SpawnTimer, 0x5) { GET(SpawnManagerClass* const, pThis, ESI); + int delay = 20; if (auto const pOwner = pThis->Owner) { auto const pTypeExt = TechnoExt::ExtMap.Find(pOwner)->TypeExtData; @@ -109,12 +110,11 @@ DEFINE_HOOK(0x6B73B9, SpawnManagerClass_AI_SpawnTimer, 0x5) pThis->SpawnTimer.Start(pTypeExt->Spawner_DelayFrames.Get()); return 0x6B73C4; } - - R->ECX(pOwner->GetTechnoType()->MissileSpawn ? 9 : 20); - return 0; + if (pOwner->GetTechnoType()->MissileSpawn) + delay = 9; } - R->ECX(20); + R->ECX(delay); return 0; } From ba56571a9dc1c7b5184c5b48e1d6103ebad4df89 Mon Sep 17 00:00:00 2001 From: Noble_Fish <1065703286@qq.com> Date: Fri, 17 Jul 2026 10:32:01 +0800 Subject: [PATCH 7/7] clean --- src/Ext/Techno/Hooks.Misc.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Ext/Techno/Hooks.Misc.cpp b/src/Ext/Techno/Hooks.Misc.cpp index 334f2a8890..bc9585fe9b 100644 --- a/src/Ext/Techno/Hooks.Misc.cpp +++ b/src/Ext/Techno/Hooks.Misc.cpp @@ -100,7 +100,6 @@ DEFINE_HOOK(0x6B73B9, SpawnManagerClass_AI_SpawnTimer, 0x5) { GET(SpawnManagerClass* const, pThis, ESI); - int delay = 20; if (auto const pOwner = pThis->Owner) { auto const pTypeExt = TechnoExt::ExtMap.Find(pOwner)->TypeExtData; @@ -110,11 +109,8 @@ DEFINE_HOOK(0x6B73B9, SpawnManagerClass_AI_SpawnTimer, 0x5) pThis->SpawnTimer.Start(pTypeExt->Spawner_DelayFrames.Get()); return 0x6B73C4; } - if (pOwner->GetTechnoType()->MissileSpawn) - delay = 9; } - R->ECX(delay); return 0; }