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

Commit a1f5bbc

Browse files
committed
Actor shouldn't go from INACTIVE status to UNSTABLE via impulse;
`AHuman::DrawHUD` is missing a BG arm check; `Magazine` should never report as empty if its capacity is infinite, so that round count can be used for other stuff via Lua; `GibParticle`s should only inherit team when set to ignore it, because otherwise `AEmitter`s wont cause friendly fire when they should; Turret-held devices should always gib when detached;
1 parent 426e055 commit a1f5bbc

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

Entities/AHuman.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4301,7 +4301,7 @@ void AHuman::DrawHUD(BITMAP *pTargetBitmap, const Vector &targetPos, int whichSc
43014301

43024302
m_HUDStack -= 10;
43034303
if (m_pFGArm && !m_EquipHUDTimer.IsPastRealMS(500)) {
4304-
std::string equippedItemsString = (m_pFGArm->HoldsSomething() ? m_pFGArm->GetHeldMO()->GetPresetName() : "EMPTY") + (m_pBGArm->HoldsSomething() ? " | " + m_pBGArm->GetHeldMO()->GetPresetName() : "");
4304+
std::string equippedItemsString = (m_pFGArm->HoldsSomething() ? m_pFGArm->GetHeldMO()->GetPresetName() : "EMPTY") + (m_pBGArm && m_pBGArm->HoldsSomething() ? " | " + m_pBGArm->GetHeldMO()->GetPresetName() : "");
43054305
pSmallFont->DrawAligned(&allegroBitmap, drawPos.GetFloorIntX() + 1, drawPos.GetFloorIntY() + m_HUDStack + 3, equippedItemsString, GUIFont::Centre);
43064306
m_HUDStack -= 9;
43074307
}

Entities/Actor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,7 @@ void Actor::Update()
14711471
const float damage = std::max(impulse / (m_GibImpulseLimit - m_TravelImpulseDamage) * m_MaxHealth, 0.0F);
14721472
m_Health -= damage;
14731473
if (damage > 0 && m_Health > 0 && m_PainSound) { m_PainSound->Play(m_Pos); }
1474-
if (m_Status != DYING && m_Status != DEAD) { m_Status = UNSTABLE; }
1474+
if (m_Status == Actor::STABLE) { m_Status = UNSTABLE; }
14751475
m_ForceDeepCheck = true;
14761476
}
14771477

Entities/MOSRotating.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,8 +1031,10 @@ void MOSRotating::CreateGibsWhenGibbing(const Vector &impactImpulse, MovableObje
10311031
gibParticleClone->SetAngularVel((gibParticleClone->GetAngularVel() * 0.35F) + (gibParticleClone->GetAngularVel() * 0.65F / mass) * RandomNum());
10321032
gibParticleClone->SetVel(gibVelocity + (gibSettingsObject.InheritsVelocity() ? (m_PrevVel + m_Vel) / 2 : Vector()));
10331033
if (movableObjectToIgnore) { gibParticleClone->SetWhichMOToNotHit(movableObjectToIgnore); }
1034-
gibParticleClone->SetTeam(m_Team);
1035-
gibParticleClone->SetIgnoresTeamHits(gibSettingsObject.IgnoresTeamHits());
1034+
if (gibSettingsObject.IgnoresTeamHits()) {
1035+
gibParticleClone->SetTeam(m_Team);
1036+
gibParticleClone->SetIgnoresTeamHits(true);
1037+
}
10361038

10371039
g_MovableMan.AddParticle(gibParticleClone);
10381040
}
@@ -1069,8 +1071,10 @@ void MOSRotating::CreateGibsWhenGibbing(const Vector &impactImpulse, MovableObje
10691071
}
10701072
gibParticleClone->SetVel(gibVelocity + (gibSettingsObject.InheritsVelocity() ? (m_PrevVel + m_Vel) / 2 : Vector()));
10711073
if (movableObjectToIgnore) { gibParticleClone->SetWhichMOToNotHit(movableObjectToIgnore); }
1072-
gibParticleClone->SetTeam(m_Team);
1073-
gibParticleClone->SetIgnoresTeamHits(gibSettingsObject.IgnoresTeamHits());
1074+
if (gibSettingsObject.IgnoresTeamHits()) {
1075+
gibParticleClone->SetTeam(m_Team);
1076+
gibParticleClone->SetIgnoresTeamHits(true);
1077+
}
10741078

10751079
g_MovableMan.AddParticle(gibParticleClone);
10761080
}

Entities/Magazine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ ClassInfoGetters;
157157
// Arguments: None.
158158
// Return value: Whether this Magazine is out of rounds or not.
159159

160-
bool IsEmpty() const { return m_FullCapacity == 0 || m_RoundCount == 0; }
160+
bool IsEmpty() const { return m_FullCapacity >= 0 && m_RoundCount == 0; }
161161

162162

163163
//////////////////////////////////////////////////////////////////////////////////////////

Entities/Turret.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ namespace RTE {
7777

7878
m_MountedDevices.at(0)->SetInheritsRotAngle(false);
7979
m_MountedDevices.at(0)->SetUnPickupable(true);
80+
m_MountedDevices.at(0)->SetGibWithParentChance(1.0F);
8081
//Force weapons mounted on turrets to never be removed due to forces. This doesn't affect them gibbing from hitting their impulse limits though.
8182
m_MountedDevices.at(0)->SetJointStrength(0.0F);
8283
}
@@ -96,6 +97,7 @@ namespace RTE {
9697

9798
newMountedDevice->SetInheritsRotAngle(false);
9899
newMountedDevice->SetUnPickupable(true);
100+
newMountedDevice->SetGibWithParentChance(1.0F);
99101
//Force weapons mounted on turrets to never be removed due to forces. This doesn't affect them gibbing from hitting their impulse limits though.
100102
newMountedDevice->SetJointStrength(0.0F);
101103
}

0 commit comments

Comments
 (0)