2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 09:47:43 +00:00

CDamageInfo: Make certain constructors constexpr

Allows eliminating potential runtime static constructors by allowing
file-scope instances to be declared constexpr.
This commit is contained in:
Lioncash
2020-01-31 01:48:04 -05:00
parent 918f1a9fcb
commit 495ff19aad
6 changed files with 14 additions and 9 deletions

View File

@@ -1100,7 +1100,7 @@ void CWallCrawlerSwarm::Touch(CActor& other, CStateManager& mgr) {
zeus::CAABox aabb(b.GetTranslation() - radius, b.GetTranslation() + radius);
if (playerTb->intersects(aabb)) {
if (b.GetActive() && x558_flavor == EFlavor::Parasite) {
CDamageInfo dInfo(CWeaponMode(EWeaponType::AI), 2.0e-05f, 0.f, 0.f);
constexpr CDamageInfo dInfo(CWeaponMode(EWeaponType::AI), 2.0e-05f, 0.f, 0.f);
mgr.ApplyDamage(GetUniqueId(), player->GetUniqueId(), GetUniqueId(), dInfo,
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {}), zeus::skZero3f);
KillBoid(b, mgr, 0.f, 1.f);