diff --git a/CREDITS.md b/CREDITS.md index 38d3de103f..2c069b2722 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -701,6 +701,7 @@ This page lists all the individual contributions to the project by their author. - `ZAdjust` for Projectiles - Allow Laser drawing position update - Customize the distance for `NoQueueUpToEnter` transport units to board passengers + - 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/New-or-Enhanced-Logics.md b/docs/New-or-Enhanced-Logics.md index 715dd6473a..c157b2bc4e 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/Whats-New.md b/docs/Whats-New.md index 53636cf3a5..179c837071 100644 --- a/docs/Whats-New.md +++ b/docs/Whats-New.md @@ -737,6 +737,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) 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 " diff --git a/src/Ext/Techno/Hooks.Misc.cpp b/src/Ext/Techno/Hooks.Misc.cpp index ce18ec3346..bc9585fe9b 100644 --- a/src/Ext/Techno/Hooks.Misc.cpp +++ b/src/Ext/Techno/Hooks.Misc.cpp @@ -95,8 +95,8 @@ 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); @@ -105,7 +105,10 @@ DEFINE_HOOK(0x6B73AD, SpawnManagerClass_AI_SpawnTimer, 0x5) auto const pTypeExt = TechnoExt::ExtMap.Find(pOwner)->TypeExtData; if (pTypeExt->Spawner_DelayFrames.isset()) - R->ECX(pTypeExt->Spawner_DelayFrames.Get()); + { + pThis->SpawnTimer.Start(pTypeExt->Spawner_DelayFrames.Get()); + return 0x6B73C4; + } } return 0;