Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 726e87a

Browse files
committed
Merge branch 'pre4-testing' into 4zk-content-source
2 parents 3908947 + 36b22f9 commit 726e87a

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

Entities/AHuman.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4308,9 +4308,8 @@ void AHuman::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whichSc
43084308
}
43094309
// Held-related GUI stuff
43104310
else if (m_pFGArm || m_pBGArm) {
4311-
HDFirearm *fgHeldFirearm = dynamic_cast<HDFirearm *>(m_pFGArm->GetHeldDevice());
4312-
MovableObject *bgHeldItem = GetEquippedBGItem();
4313-
const HDFirearm *bgHeldFirearm = dynamic_cast<HDFirearm *>(bgHeldItem);
4311+
HDFirearm *fgHeldFirearm = dynamic_cast<HDFirearm *>(GetEquippedItem());
4312+
HDFirearm *bgHeldFirearm = dynamic_cast<HDFirearm *>(GetEquippedBGItem());
43144313

43154314
if (fgHeldFirearm || bgHeldFirearm) {
43164315
str[0] = -56; str[1] = 0;
@@ -4327,7 +4326,7 @@ void AHuman::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whichSc
43274326
}
43284327
}
43294328

4330-
if (bgHeldItem && bgHeldFirearm) {
4329+
if (bgHeldFirearm) {
43314330
std::string bgWeaponString;
43324331
if (bgHeldFirearm->IsReloading()) {
43334332
bgWeaponString = "Reloading";
@@ -4359,7 +4358,7 @@ void AHuman::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whichSc
43594358
m_HUDStack -= 11;
43604359
}
43614360
*/
4362-
std::string equippedItemsString = (m_pFGArm->HoldsSomething() ? m_pFGArm->GetHeldMO()->GetPresetName() : "EMPTY") + (m_pBGArm->HoldsSomething() ? " | " + m_pBGArm->GetHeldMO()->GetPresetName() : "");
4361+
std::string equippedItemsString = (m_pFGArm && m_pFGArm->HoldsSomething() ? m_pFGArm->GetHeldMO()->GetPresetName() : "EMPTY") + (m_pBGArm && m_pBGArm->HoldsSomething() ? " | " + m_pBGArm->GetHeldMO()->GetPresetName() : "");
43634362
pSmallFont->DrawAligned(&allegroBitmap, drawPos.GetFloorIntX() + 1, drawPos.GetFloorIntY() + m_HUDStack + 3, equippedItemsString, GUIFont::Centre);
43644363
m_HUDStack -= 9;
43654364
/*

Entities/AtomGroup.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,10 @@ namespace RTE {
235235
m_Atoms.push_back(atomToAdd);
236236
m_SubGroups.at(subgroupID).push_back(atomToAdd);
237237
}
238-
if (!atomList.empty()) { m_MomentOfInertia = 0.0F; }
238+
if (!atomList.empty()) {
239+
m_MomentOfInertia = 0.0F;
240+
if (m_OwnerMOSR) { GetMomentOfInertia(); }
241+
}
239242
}
240243

241244
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -257,7 +260,10 @@ namespace RTE {
257260
}
258261
}
259262
m_SubGroups.erase(removeID);
260-
if (removedAny) { m_MomentOfInertia = 0.0F; }
263+
if (removedAny) {
264+
m_MomentOfInertia = 0.0F;
265+
if (m_OwnerMOSR) { GetMomentOfInertia(); }
266+
}
261267

262268
return removedAny;
263269
}

Entities/Attachable.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,12 @@ namespace RTE {
216216
}
217217
totalImpulseForce *= jointStiffnessValueToUse;
218218

219-
if (gibImpulseLimitValueToUse > 0 && totalImpulseForce.GetMagnitude() > gibImpulseLimitValueToUse) {
219+
float totalImpulseForceMagnitude = totalImpulseForce.GetMagnitude();
220+
if (gibImpulseLimitValueToUse > 0 && totalImpulseForceMagnitude > gibImpulseLimitValueToUse) {
220221
jointImpulses += totalImpulseForce.SetMagnitude(gibImpulseLimitValueToUse);
221222
GibThis();
222223
return false;
223-
} else if (jointStrengthValueToUse > 0 && totalImpulseForce.GetMagnitude() > jointStrengthValueToUse) {
224+
} else if (jointStrengthValueToUse > 0 && totalImpulseForceMagnitude > jointStrengthValueToUse) {
224225
jointImpulses += totalImpulseForce.SetMagnitude(jointStrengthValueToUse);
225226
m_Parent->RemoveAttachable(this, true, true);
226227
return false;

0 commit comments

Comments
 (0)