Skip to content

Commit f7eaf81

Browse files
committed
Remove console spam from music man
1 parent 341bb67 commit f7eaf81

File tree

2 files changed

+6
-36
lines changed

2 files changed

+6
-36
lines changed

Data/Base.rte/AI/SharedBehaviors.lua

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -522,25 +522,12 @@ function SharedBehaviors.GoToWpt(AI, Owner, Abort)
522522
end
523523

524524
-- predict jetpack movement...
525-
local jetStrength = AI.jetImpulseFactor / Owner.Mass;
526-
local t = math.min(0.4, Owner.Jetpack.JetTimeLeft*0.001);
527-
local PixelVel = Owner.Vel * (GetPPM() * t);
528-
local Accel = SceneMan.GlobalAcc * GetPPM();
529-
530-
-- a burst use 10x more fuel
531-
if Owner.Jetpack:CanTriggerBurst() then
532-
t = math.max(math.min(0.4, Owner.Jetpack.JetTimeLeft*0.001-TimerMan.AIDeltaTimeSecs*10), TimerMan.AIDeltaTimeSecs);
533-
end
525+
local jumpHeight = Owner.JumpHeight;
534526

535527
-- when jumping (check four directions)
536528
for k, Face in pairs(Facings) do
537-
local JetAccel = Vector(-jetStrength, 0):RadRotate(Owner.RotAngle+1.375*math.pi+Face.facing*0.25);
538-
local JumpPos = Owner.Head.Pos + PixelVel + (Accel + JetAccel) * (t*t*0.5);
539-
540-
-- a burst add a one time boost to acceleration
541-
if Owner.Jetpack:CanTriggerBurst() then
542-
JumpPos = JumpPos + Vector(-AI.jetBurstFactor, 0):AbsRotateTo(JetAccel);
543-
end
529+
local JetAccel = Vector(-jumpHeight, 0):RadRotate(Owner.RotAngle+1.375*math.pi+Face.facing*0.25);
530+
local JumpPos = Owner.Head.Pos + JetAccel;
544531

545532
-- check for obstacles from the head
546533
Trace = SceneMan:ShortestDistance(Owner.Head.Pos, JumpPos, false);

Source/Managers/MusicMan.cpp

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,16 @@ void MusicMan::Update() {
5454
if (m_PreviousSoundContainerSetToFade && m_MusicFadeTimer.IsPastRealTimeLimit()) {
5555
m_PreviousSoundContainerSetToFade = false;
5656
if (m_PreviousSoundContainer) {
57-
g_ConsoleMan.PrintString("MusicMan: Faded PreviousSoundContainer due to SetToFade.");
5857
const int musicFadeOutTimeMs = 250;
5958
m_PreviousSoundContainer->FadeOut(musicFadeOutTimeMs);
6059
}
6160
}
6261
} else if (!m_ReturnToDynamicMusic) {
6362
if (m_CurrentSoundContainer && m_CurrentSoundContainer->GetAudibleVolume() == 0.0F) {
64-
g_ConsoleMan.PrintString("MusicMan: Inaudible CurrentSoundContainer is about to be deleted: " + m_CurrentSoundContainer->GetPresetName());
6563
m_CurrentSoundContainer = nullptr;
6664
}
6765
}
6866
if (m_PreviousSoundContainer && m_PreviousSoundContainer->GetAudibleVolume() == 0.0F) {
69-
g_ConsoleMan.PrintString("MusicMan: Inaudible PreviousSoundContainer is about to be deleted: " + m_PreviousSoundContainer->GetPresetName());
7067
m_PreviousSoundContainer = nullptr;
7168
}
7269
}
@@ -110,7 +107,6 @@ bool MusicMan::PlayDynamicSong(const std::string& songName, const std::string& s
110107
// If this isn't the case, then the MusicTimer's existing setup should make it play properly anyway, even if it's just instant
111108
if (playImmediately) {
112109
if (m_IsPlayingDynamicMusic) {
113-
g_ConsoleMan.PrintString("MusicMan: Immediately played DynamicSong has stopped PreviousSoundContainer.");
114110
if (m_PreviousSoundContainer) {
115111
m_PreviousSoundContainer->Stop();
116112
m_PreviousSoundContainer = nullptr;
@@ -127,13 +123,10 @@ bool MusicMan::PlayDynamicSong(const std::string& songName, const std::string& s
127123
}
128124

129125
bool MusicMan::SetNextDynamicSongSection(const std::string& newSongSectionType, bool playImmediately, bool playTransition, bool smoothFade) {
130-
g_ConsoleMan.PrintString("MusicMan: Attempting to set next DynamicSongSection...");
131126
std::string currentDynamicSongSection = "None";
132127
if (m_NextSongSection) {
133128
currentDynamicSongSection = m_NextSongSection->GetPresetName();
134129
}
135-
g_ConsoleMan.PrintString("Current DynamicSongSection: " + currentDynamicSongSection);
136-
g_ConsoleMan.PrintString("Desired new DynamicSongSection: " + newSongSectionType);
137130

138131
if (!m_IsPlayingDynamicMusic) {
139132
return false;
@@ -142,9 +135,7 @@ bool MusicMan::SetNextDynamicSongSection(const std::string& newSongSectionType,
142135
SelectNextSongSection();
143136
SelectNextSoundContainer(playTransition);
144137
if (playImmediately) {
145-
g_ConsoleMan.PrintString("Playing new song section immediately!");
146138
if (m_PreviousSoundContainerSetToFade) {
147-
g_ConsoleMan.PrintString("MusicMan: Immediately played new song section has stopped PreviousSoundContainer.");
148139
m_PreviousSoundContainerSetToFade = false;
149140
if (m_PreviousSoundContainer) {
150141
m_PreviousSoundContainer->Stop();
@@ -157,44 +148,38 @@ bool MusicMan::SetNextDynamicSongSection(const std::string& newSongSectionType,
157148
}
158149

159150
bool MusicMan::CyclePlayingSoundContainers(bool smoothFade) {
160-
g_ConsoleMan.PrintString("MusicMan: Cycling SoundContainers...");
161151
std::string currentSoundContainer = "None";
162152
if (m_CurrentSoundContainer) {
163153
currentSoundContainer = m_CurrentSoundContainer->GetPresetName();
164154
}
165-
g_ConsoleMan.PrintString("Current sound container: " + currentSoundContainer);
166-
g_ConsoleMan.PrintString("Next sound container: " + m_NextSoundContainer->GetPresetName());
155+
167156
std::string previousSoundContainer = "None";
168157
if (m_PreviousSoundContainer) {
169158
previousSoundContainer = m_PreviousSoundContainer->GetPresetName();
170159
}
171-
g_ConsoleMan.PrintString("Previous sound container: " + previousSoundContainer);
172160

173161
if (m_CurrentSoundContainer && m_CurrentSoundContainer->IsBeingPlayed()) {
174162
if (smoothFade) {
175163
m_CurrentSoundContainer->FadeOut(static_cast<int>(m_NextSoundContainer->GetMusicPreEntryTime()));
176164
} else if (!m_MusicTimer.IsPastRealTimeLimit()) {
177-
g_ConsoleMan.PrintString("No smoothFade and premature cycling means upcoming PreviousSoundContainer will be faded out at entry point.");
178165
m_PreviousSoundContainerSetToFade = true;
179166
m_MusicFadeTimer.Reset();
180167
m_MusicFadeTimer.SetRealTimeLimitMS(static_cast<int>(m_NextSoundContainer->GetMusicPreEntryTime()));
181168
}
182169
if (m_PreviousSoundContainer) {
183-
g_ConsoleMan.PrintString("Found unfaded PreviousSoundContainer. Stopping: " + m_PreviousSoundContainer->GetPresetName());
184170
m_PreviousSoundContainerSetToFade = false;
185171
m_PreviousSoundContainer->Stop();
186172
m_PreviousSoundContainer = nullptr;
187173
}
188174
m_PreviousSoundContainer = std::unique_ptr<SoundContainer>(m_CurrentSoundContainer.release());
189-
g_ConsoleMan.PrintString("Moved CurrentSoundContainer to PreviousSoundContainer while cycling, it is now: " + m_PreviousSoundContainer->GetPresetName());
190175
}
191176

192177
// Clone instead of just point to because we might wanna keep this around even if the DynamicSong is gone
193178
m_CurrentSoundContainer = std::unique_ptr<SoundContainer>(dynamic_cast<SoundContainer*>(m_NextSoundContainer->Clone()));
194179
SelectNextSoundContainer();
195-
m_MusicTimer.Reset();
180+
196181
double timeUntilNextShouldBePlayed = std::max(0.0F, m_CurrentSoundContainer->GetMusicExitTime() - m_NextSoundContainer->GetMusicPreEntryTime());
197-
g_ConsoleMan.PrintString("Time until next should be played:" + std::to_string(timeUntilNextShouldBePlayed));
182+
m_MusicTimer.Reset();
198183
m_MusicTimer.SetRealTimeLimitMS(timeUntilNextShouldBePlayed);
199184
m_CurrentSoundContainer->Play();
200185
m_CurrentSongSectionType = m_NextSongSectionType;
@@ -254,7 +239,6 @@ void MusicMan::PlayInterruptingMusic(const SoundContainer* soundContainer) {
254239
}
255240

256241
void MusicMan::EndInterruptingMusic() {
257-
g_ConsoleMan.PrintString("MusicMan: Ending interrupting music.");
258242
if (m_InterruptingMusicSoundContainer && m_InterruptingMusicSoundContainer->IsBeingPlayed()) {
259243
m_InterruptingMusicSoundContainer->Stop();
260244

@@ -263,7 +247,6 @@ void MusicMan::EndInterruptingMusic() {
263247
}
264248

265249
if (m_CurrentSoundContainer != nullptr) {
266-
g_ConsoleMan.PrintString("Unpausing CurrentSoundContainer.");
267250
m_CurrentSoundContainer->SetPaused(false);
268251
}
269252

0 commit comments

Comments
 (0)