From ca34be7025e28732247558dfb5bea1523c6633b6 Mon Sep 17 00:00:00 2001 From: florianf Date: Sat, 30 Jan 2010 10:43:02 +0000 Subject: [PATCH] Bug 507: Reset stuff upon player death If Tux dies while he is subject to increased gravity (jump_early_apex), he retains this attribute during the dying sequence, which looks weird. I will attach a patch that resets the safe_timer and gravity and, for consistency, resets the invincibility upon death instead of checking !dying when creating sparkles. Resolves #507. Thanks to Matt McCutchen for this patch. git-svn-id: http://supertux.lethargik.org/svn/supertux/trunk/supertux@6290 837edb03-e0f3-0310-88ca-d4d4e8b29345 --- src/object/player.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/object/player.cpp b/src/object/player.cpp index 77ef59395..06941c649 100644 --- a/src/object/player.cpp +++ b/src/object/player.cpp @@ -390,7 +390,7 @@ Player::update(float elapsed_time) ice_this_frame = false; // when invincible, spawn particles - if (invincible_timer.started() && !dying) + if (invincible_timer.started()) { if (systemRandom.rand(0, 2) == 0) { float px = systemRandom.randf(bbox.p1.x+0, bbox.p2.x-0); @@ -1291,6 +1291,9 @@ Player::kill(bool completely) GameSession::current()->set_reset_point("", Vector()); } physic.enable_gravity(true); + physic.set_gravity_modifier(1.0f); // Undo jump_early_apex + safe_timer.stop(); + invincible_timer.stop(); physic.set_acceleration(0, 0); physic.set_velocity(0, -700); set_bonus(NO_BONUS, true); -- 2.11.0