Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Fixed-or-Improved-Logics.md
Original file line number Diff line number Diff line change
Expand Up @@ -2447,7 +2447,7 @@ AnimList.PickRandom=false ; boolean
AnimList.CreateAll=false ; boolean
AnimList.CreationInterval=0 ; integer
AnimList.ScatterMin=0.0 ; floating point value, distance in cells
AnimList.ScatterMax=0.0 ; floating point value, distance in cells
AnimList.ScatterMax= ; floating point value, distance in cells, default to 0.125 if [Projectile] -> Inviso=true, and 0 if false
SplashList= ; List of AnimationTypes, default to [CombatDamage] -> SplashList
SplashList.PickRandom=false ; boolean
SplashList.CreateAll=false ; boolean
Expand Down
1 change: 1 addition & 0 deletions docs/Whats-New.md
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,7 @@ Phobos fixes:
- Fixed the bug that the upgrade building's power-enhancing effect depends only on its parent building and is not related to the upgrade building itself (by NetsuNegi)
- Fixed an issue where hover vehicles could not be destroyed after malfunctioning on water surfaces (by FlyStar)
- Fixed an issue where shadow matrix scaling was incorrectly applied to `TurretOffset` causing turret shadow misplacement (by Noble_Fish)
- Fixed an issue that customizable warhead animation scatter cannot override 32 leptons scatter of `Inviso=yes` projectile (by NetsuNegi)

Fixes / interactions with other extensions:
<!-- - Allowed `AuxBuilding` and Ares' `SW.Aux/NegBuildings` to count building upgrades (by Ollerus) -->
Expand Down
5 changes: 5 additions & 0 deletions docs/locale/zh_CN/LC_MESSAGES/Whats-New.po
Original file line number Diff line number Diff line change
Expand Up @@ -2301,6 +2301,11 @@ msgid ""
"`TurretOffset` causing turret shadow misplacement (by Noble_Fish)"
msgstr "修复了一个影子矩阵缩放错误地应用于 `TurretOffset` 而导致炮塔影子错位的问题(by Noble_Fish)"

msgid ""
"Fixed an issue that customizable warhead animation scatter cannot "
"override 32 leptons scatter of `Inviso=yes` projectile (by NetsuNegi)"
msgstr "修复了自定义弹头动画散布范围不能覆盖 `Inviso=yes` 抛射体自带 32 leptons 散布的问题(by NetsuNegi)"

msgid "Fixes / interactions with other extensions:"
msgstr "其他扩展引擎相关的修复/交互:"

Expand Down
10 changes: 8 additions & 2 deletions src/Ext/Bullet/Hooks.DetonateLogics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,8 @@ DEFINE_HOOK(0x469B44, BulletClass_Logics_LandTypeCheck, 0x6)
return 0;
}

DEFINE_JUMP(LJMP, 0x469AC1, 0x469AF0) // Skip random scatter in vanilla code

DEFINE_HOOK(0x469C46, BulletClass_Logics_DamageAnimSelected, 0x8)
{
enum { SkipGameCode = 0x469C98 };
Expand Down Expand Up @@ -280,7 +282,7 @@ DEFINE_HOOK(0x469C46, BulletClass_Logics_DamageAnimSelected, 0x8)
int* remainingInterval = &pWHExt->RemainingAnimCreationInterval;
const int scatterMin = splashed ? pWHExt->SplashList_ScatterMin.Get() : pWHExt->AnimList_ScatterMin.Get();
const int scatterMax = splashed ? pWHExt->SplashList_ScatterMax.Get() : pWHExt->AnimList_ScatterMax.Get();
const bool allowScatter = scatterMax != 0 || scatterMin != 0;
const bool allowScatter = scatterMax >= 0 || pThis->Type->Inviso;

if (creationInterval > 0 && pOwner)
remainingInterval = &TechnoExt::ExtMap.Find(pOwner)->WHAnimRemainingCreationInterval;
Expand Down Expand Up @@ -329,7 +331,11 @@ DEFINE_HOOK(0x469C46, BulletClass_Logics_DamageAnimSelected, 0x8)

if (allowScatter)
{
const int distance = random.RandomRanged(scatterMin, scatterMax);
int distance = 32;

if (scatterMax >= 0)
distance = random(std::max(scatterMin, 0), scatterMax);

animCoords = MapClass::GetRandomCoordsNear(animCoords, distance, false);
}

Expand Down
8 changes: 4 additions & 4 deletions src/Ext/WarheadType/Body.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,13 @@ class WarheadTypeExt
, SplashList_PickRandom { false }
, SplashList_CreateAll { false }
, SplashList_CreationInterval { 0 }
, SplashList_ScatterMin { Leptons(0) }
, SplashList_ScatterMax { Leptons(0) }
, SplashList_ScatterMin { Leptons(-1) }
, SplashList_ScatterMax { Leptons(-1) }
, AnimList_PickRandom { false }
, AnimList_CreateAll { false }
, AnimList_CreationInterval { 0 }
, AnimList_ScatterMin { Leptons(0) }
, AnimList_ScatterMax { Leptons(0) }
, AnimList_ScatterMin { Leptons(-1) }
, AnimList_ScatterMax { Leptons(-1) }
, CreateAnimsOnZeroDamage { false }
, Conventional_IgnoreUnits { false }
, RemoveDisguise { false }
Expand Down
Loading