Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hit effects bug fixes #462

Merged
merged 4 commits into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ bin/skins/*
!bin/skins/Default
bin/skins/Default/skin.cfg
bin/replays
bin/profiles

# Intermediate Files
x64
Expand Down
2 changes: 0 additions & 2 deletions Main/src/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,6 @@ class Game_Impl : public Game

~Game_Impl()
{
if (m_track)
g_input.OnButtonReleased.Remove(m_track, &Track::OnButtonReleased);
delete m_track;
delete m_background;
delete m_foreground;
Expand Down
2 changes: 2 additions & 0 deletions Main/src/Scoring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,8 @@ bool Scoring::HoldObjectAvailable(uint32 index, bool checkIfPassedCritLine)
auto currentTime = m_playback->GetLastTime();
auto tick = m_ticks[index].front();
auto obj = (HoldObjectState*)tick->object;
if (obj->type != ObjectType::Hold)
return false;
// When a hold passes the crit line and we're eligible to hit the starting tick,
// change the idle hit effect to the crit hit effect
bool withinHoldStartWindow = tick->HasFlag(TickFlags::Start) && m_IsBeingHold(tick) && (!checkIfPassedCritLine || obj->time <= currentTime);
Expand Down
7 changes: 4 additions & 3 deletions Main/src/Track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ Track::Track()

Track::~Track()
{
delete loader;
g_input.OnButtonReleased.Remove(this, &Track::OnButtonReleased);

delete loader;
for (auto & i : m_laserTrackBuilder)
delete i;
for (auto & m_hitEffect : m_hitEffects)
Expand All @@ -35,6 +36,8 @@ Track::~Track()

bool Track::AsyncLoad()
{
g_input.OnButtonReleased.Add(this, &Track::OnButtonReleased);

loader = new AsyncAssetLoader();
String skin = g_application->GetCurrentSkin();

Expand Down Expand Up @@ -224,8 +227,6 @@ bool Track::AsyncFinalize()
timedHitEffect->time = 0;
timedHitEffect->track = this;

g_input.OnButtonReleased.Add(this, &Track::OnButtonReleased);

bool delayedHitEffects = g_gameConfig.GetBool(GameConfigKeys::DelayedHitEffects);

for (int i = 0; i < 6; ++i)
Expand Down