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

Commit a31d76a

Browse files
committed
Merge branch 'development' into pre4-testing
# Conflicts: # Entities/HDFirearm.cpp - Used pre4-testing version since Deactivate plays the deactivation sound anyway # Entities/SoundContainer.h - Used development version since there wasn't really a conflict
2 parents 4ac8db1 + c177277 commit a31d76a

File tree

5 files changed

+11
-24
lines changed

5 files changed

+11
-24
lines changed

Entities/ACrab.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2647,8 +2647,10 @@ void ACrab::Draw(BITMAP *pTargetBitmap, const Vector &targetPos, DrawMode mode,
26472647
}
26482648

26492649
if (mode == g_DrawColor && !onlyPhysical && g_SettingsMan.DrawLimbPathVisualizations()) {
2650-
m_Paths[LEFTSIDE][WALK]->Draw(pTargetBitmap, targetPos, 122);
2651-
m_Paths[RIGHTSIDE][WALK]->Draw(pTargetBitmap, targetPos, 122);
2650+
m_Paths[LEFTSIDE][BGROUND][WALK].Draw(pTargetBitmap, targetPos, 122);
2651+
m_Paths[LEFTSIDE][FGROUND][WALK].Draw(pTargetBitmap, targetPos, 122);
2652+
m_Paths[RIGHTSIDE][BGROUND][WALK].Draw(pTargetBitmap, targetPos, 122);
2653+
m_Paths[RIGHTSIDE][FGROUND][WALK].Draw(pTargetBitmap, targetPos, 122);
26522654
}
26532655
}
26542656

Entities/HDFirearm.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ int HDFirearm::ReadProperty(const std::string_view &propName, Reader &reader) {
173173
} else if (propName == "DeactivationSound") {
174174
m_DeactivationSound = new SoundContainer;
175175
reader >> m_DeactivationSound;
176-
m_DeactivationSound->SetSoundOverlapMode(SoundContainer::SoundOverlapMode::RESTART);
177176
} else if (propName == "EmptySound") {
178177
m_EmptySound = new SoundContainer;
179178
reader >> m_EmptySound;
@@ -617,6 +616,7 @@ void HDFirearm::Activate() {
617616
HeldDevice::Activate();
618617

619618
if (!IsReloading()) {
619+
if (m_DeactivationSound && m_DeactivationSound->IsBeingPlayed()) { m_DeactivationSound->FadeOut(); }
620620
if (m_ActiveSound && !m_ActiveSound->IsBeingPlayed()) { m_ActiveSound->Play(this->m_Pos); }
621621
if (m_PreFireSound && !wasActivated && !m_PreFireSound->IsBeingPlayed()) { m_PreFireSound->Play(this->m_Pos); }
622622
if (IsEmpty()) { Reload(); }
@@ -635,9 +635,9 @@ void HDFirearm::Deactivate() {
635635
HeldDevice::Deactivate();
636636
m_FiredOnce = false;
637637

638-
if (m_PreFireSound) { m_PreFireSound->Stop(); }
638+
if (m_PreFireSound) { m_PreFireSound->FadeOut(); }
639639
if (m_FireSound && m_FireSound->GetLoopSetting() == -1) { m_FireSound->Stop(); }
640-
if (m_DeactivationSound && wasActivated && m_pMagazine && !m_pMagazine->IsEmpty()) { m_DeactivationSound->Play(m_Pos); }
640+
if (m_DeactivationSound && wasActivated && m_FiredLastFrame) { m_DeactivationSound->Play(m_Pos); }
641641
}
642642

643643
//////////////////////////////////////////////////////////////////////////////////////////
@@ -960,11 +960,9 @@ void HDFirearm::Update()
960960
// Do stuff to deactivate after being activated
961961
if (!m_Activated)
962962
{
963-
if (m_AlreadyClicked && m_FiredLastFrame && m_DeactivationSound) { m_DeactivationSound->Play(m_Pos); }
964963
// Reset the click indicator.
965964
m_AlreadyClicked = false;
966965

967-
if (m_PreFireSound) { m_PreFireSound->Stop(); }
968966
// Stop any looping activation sounds
969967
if (m_FireSound && m_FireSound->GetLoopSetting() == -1)// && m_FireSound->IsBeingPlayed())
970968
m_FireSound->Stop();

Entities/SoundSet.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace RTE {
1717

1818
void SoundSet::Clear() {
1919
m_SoundSelectionCycleMode = SoundSelectionCycleMode::RANDOM;
20-
m_CurrentSelection = {false, 0};
20+
m_CurrentSelection = {false, -1};
2121

2222
m_SoundData.clear();
2323
m_SubSoundSets.clear();
@@ -286,9 +286,7 @@ namespace RTE {
286286
case 0:
287287
return false;
288288
case 1:
289-
break;
290-
case 2:
291-
selectSoundForwards();
289+
m_CurrentSelection.second = 0;
292290
break;
293291
default:
294292
switch (m_SoundSelectionCycleMode) {

Entities/SoundSet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ namespace RTE {
210210
static const std::unordered_map<std::string, SoundSet::SoundSelectionCycleMode> c_SoundSelectionCycleModeMap; //!< A map of strings to SoundSelectionCycleModes to support string parsing for the SoundCycleMode enum. Populated in the implementing cpp file.
211211

212212
SoundSelectionCycleMode m_SoundSelectionCycleMode; //!< The SoundSelectionCycleMode for this SoundSet.
213-
std::pair<bool, int> m_CurrentSelection; //!< Whether the currently selection is in the SoundData (false) or SoundSet (true) vector, and its index in the appropriate vector.
213+
std::pair<bool, int> m_CurrentSelection; //!< Whether the current selection is in the SoundData (false) or SoundSet (true) vector, and its index in the appropriate vector.
214214

215215
std::vector<SoundData> m_SoundData; //!< The SoundData available for selection in this SoundSet.
216216
std::vector<SoundSet> m_SubSoundSets; //!< The sub SoundSets available for selection in this SoundSet.

System/Entity.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,7 @@ namespace RTE {
5454
if (preset) {
5555
preset->Clone(this);
5656
} else {
57-
if (className == "AtomGroup" || className == "Attachable" || className == "AEmitter") {
58-
reader.ReportError("The PresetName to be copied was not found in data modules.");
59-
}
60-
// If we couldn't find the preset to copy from, read it as an original but report the problem in the console
61-
g_ConsoleMan.PrintString("ERROR: Couldn't find the preset '" + refName + "' accessed in " + reader.GetCurrentFilePath() + " at line " + reader.GetCurrentFileLine());
62-
// Preset name might have "[ModuleName]/" preceding it, detect it here and select proper module!
63-
int slashPos = refName.find_first_of('/');
64-
m_PresetName = (slashPos != std::string::npos) ? refName.substr(slashPos + 1) : refName;
65-
// Mark this so that the derived class knows it should be added to the PresetMan when it's done reading all properties.
66-
m_IsOriginalPreset = true;
67-
// Indicate where this was read from
68-
m_DefinedInModule = reader.GetReadModuleID();
57+
reader.ReportError("Couldn't find the preset \"" + refName + "\" of type \"" + className + "\" when trying to do CopyOf.");
6958
}
7059
} else if (propName == "PresetName" || propName == "InstanceName") {
7160
SetPresetName(reader.ReadPropValue());

0 commit comments

Comments
 (0)