Skip to content

Commit 23376f2

Browse files
Fix WalkingBadguy handling when inactive
1 parent 01f6706 commit 23376f2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/badguy/bouncing_snowball.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,16 @@ BouncingSnowball::collision_squished(MovingObject& object)
131131
void
132132
BouncingSnowball::collision_solid(const CollisionHit& hit)
133133
{
134-
if (m_sprite->get_action() == "squished")
135-
return;
136-
137-
if (m_frozen)
134+
if (m_frozen || !is_active())
138135
{
139136
BadGuy::collision_solid(hit);
140137
return;
141138
}
142139

140+
if (m_sprite->get_action() == "squished")
141+
return;
142+
143+
143144
if (hit.bottom) {
144145
if (get_state() == STATE_ACTIVE) {
145146
float bounce_speed = -m_physic.get_velocity_y()*0.8f;

src/badguy/walking_badguy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ WalkingBadguy::collision_solid(const CollisionHit& hit)
187187

188188
update_on_ground_flag(hit);
189189

190-
if (m_frozen)
190+
if (m_frozen || !is_active())
191191
{
192192
BadGuy::collision_solid(hit);
193193
return;

0 commit comments

Comments
 (0)