Various knockback related fixes, don't call WaitForComplete in CGameaArea

This commit is contained in:
Phillip Stephens 2021-06-13 18:06:29 -07:00
parent ace87397d7
commit 933279ceb6
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
7 changed files with 25 additions and 20 deletions

View File

@ -224,8 +224,9 @@ void CBloodFlower::PodAttack(CStateManager& mgr, EStateMsg msg, float arg) {
x574_podEffect->SetParticleEmission(true);
ActivateTriggers(mgr, true);
} else if (msg == EStateMsg::Update) {
if (TooClose(mgr, 0.f))
if (!TooClose(mgr, 0.f)) {
return;
}
mgr.ApplyDamage(GetUniqueId(), mgr.GetPlayer().GetUniqueId(), GetUniqueId(), x5f8_podDamage,
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {}), {});

View File

@ -1009,14 +1009,16 @@ void CIceSheegoth::ApplyContactDamage(TUniqueId sender, CStateManager& mgr) {
if (colAct->GetHealthInfo(mgr)->GetHP() <= 0.f) {
return;
}
bool bVar5 = (xb28_29_ && !xb28_25_ && xb28_28_) ? true : IsMouthCollider(sender);
bool bite = (xb28_29_ && !xb28_25_ && xb28_28_) ? true : IsMouthCollider(sender);
if (colAct->GetLastTouchedObject() == mgr.GetPlayer().GetUniqueId()) {
if (bVar5) {
mgr.ApplyDamage(GetUniqueId(), mgr.GetPlayer().GetUniqueId(), GetUniqueId(), x56c_sheegothData.Get_x1b8(),
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {}), zeus::skZero3f);
if (!bite) {
if (x420_curDamageRemTime <= 0.f) {
mgr.ApplyDamage(GetUniqueId(), mgr.GetPlayer().GetUniqueId(), GetUniqueId(), GetContactDamage(),
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {}), zeus::skZero3f);
}
} else {
mgr.ApplyDamage(GetUniqueId(), mgr.GetPlayer().GetUniqueId(), GetUniqueId(), GetContactDamage(),
mgr.ApplyDamage(GetUniqueId(), mgr.GetPlayer().GetUniqueId(), GetUniqueId(), x56c_sheegothData.Get_x1b8(),
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {}), zeus::skZero3f);
}
}

View File

@ -1815,11 +1815,11 @@ void CMetroidPrimeExo::UpdateBoneTracking(float dt, CStateManager& mgr) {
}
void CMetroidPrimeExo::DoContactDamage(TUniqueId uid, CStateManager& mgr) {
if (TCastToConstPtr<CCollisionActor> colAct = mgr.GetObjectById(uid)) {
if (!IsAlive()) {
return;
}
if (!IsAlive()) {
return;
}
if (TCastToConstPtr<CCollisionActor> colAct = mgr.GetObjectById(uid)) {
if (colAct->GetLastTouchedObject() == mgr.GetPlayer().GetUniqueId()) {
if (mgr.GetPlayer().GetFrozenState()) {
mgr.GetPlayer().UnFreeze(mgr);

View File

@ -539,9 +539,11 @@ void CRidley::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateMan
TUniqueId tmpId = kInvalidUniqueId;
bool doDamage = false;
if (xc64_aiStage == 3) {
if (!xa32_29_ && xa31_27_) {
tmpId = x98a_breastPlateId;
doDamage = true;
if (!xa32_29_) {
if (xa31_27_) {
tmpId = x98a_breastPlateId;
doDamage = true;
}
} else {
tmpId = x988_headId;
doDamage = true;

View File

@ -209,7 +209,7 @@ void CThardus::UpdateRockThermalState(float dt, CStateManager& mgr) {
void CThardus::sub801de9f8(CStateManager& mgr) {
float dVar5 = mgr.GetActiveRandom()->Float();
if (!sub801dc2c8() || dVar5 >= 0.3f) {
if (!IsLastRock() || dVar5 >= 0.3f) {
const float local_28 = std::max(0.f, dVar5 - 0.19999999f);
if (local_28 > 0.8f) {
x5c4_ = 2;
@ -282,7 +282,7 @@ void CThardus::sub801dcfa4(CStateManager& mgr) {
ProcessSoundEvent(x758_, 1.f, 0, 0.1f, 1000.f, 0.16f, 1.f, zeus::skZero3f, GetTranslation(),
mgr.GetNextAreaId(), mgr, true);
if (sub801dc2c8() && !x8f0_) {
if (IsLastRock() && !x8f0_) {
DoDoubleSnap(mgr);
}
sub801dbc40();
@ -317,7 +317,7 @@ void CThardus::Think(float dt, CStateManager& mgr) {
UpdateRockThermalState(dt, mgr);
if (!sub801dc2c8()) {
if (!IsLastRock()) {
// NOTE: (phil), yes this is what's actually happening
#if 0
if (x648_currentRock < x610_destroyableRocks.size() - 2) {

View File

@ -146,7 +146,7 @@ class CThardus : public CPatterned {
if (x578_waypoints.empty()) {
sub801de9f8(mgr);
} else {
if (sub801dc2c8() || x5c4_ != 0 || x944_ <= 0.f)
if (IsLastRock() || x5c4_ != 0 || x944_ <= 0.f)
sub801de9f8(mgr);
else
x944_ = 0.f;
@ -157,7 +157,7 @@ class CThardus : public CPatterned {
void SetRockParticle(CStateManager& mgr, const zeus::CVector3f& pos, CAssetId particle);
void sub801dbc5c(CStateManager& mgr, CDestroyableRock* rock);
void sub801dbbdc(CStateManager& mgr, CDestroyableRock* rock);
bool sub801dc2c8() { return x648_currentRock == (x610_destroyableRocks.size() - 1); }
bool IsLastRock() { return x648_currentRock == (x610_destroyableRocks.size() - 1); }
void UpdateNonDestroyableCollisionActorMaterials(EUpdateMaterialMode mode, EMaterialTypes mat, CStateManager& mgr);
void UpdateExcludeList(const std::unique_ptr<CCollisionActorManager>& colMgr, EUpdateMaterialMode mode,
EMaterialTypes mat, CStateManager& mgr);

View File

@ -853,8 +853,8 @@ void CGameArea::Validate(CStateManager& mgr) {
while (StartStreamingMainArea()) {}
for (auto& req : xf8_loadTransactions)
req->WaitUntilComplete();
//for (auto& req : xf8_loadTransactions)
// req->WaitUntilComplete();
if (xdc_tokens.empty()) {
VerifyTokenList(mgr);