1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-13 16:44:50 +02:00

#3 stop screaming after falling into the water

This commit is contained in:
XProger
2017-09-30 02:17:14 +03:00
parent 50753cd2ec
commit b857db0b59

View File

@@ -1348,7 +1348,6 @@ struct Lara : Character {
if (health > 0.0f)
return;
Sound::stop(TR::SND_SCREAM);
game->stopTrack();
Core::lightColor[1 + 0] = Core::lightColor[1 + 1] = vec4(0, 0, 0, 1);
@@ -1836,6 +1835,7 @@ struct Lara : Character {
wpnHide();
if (stand != STAND_UNDERWATER && stand != STAND_ONWATER && (state != STATE_FALL && state != STATE_REACH && state != STATE_SWAN_DIVE && state != STATE_FAST_DIVE))
animation.setAnim(ANIM_FALL_FORTH);
stopScreaming();
return STAND_UNDERWATER;
}
@@ -1863,6 +1863,7 @@ struct Lara : Character {
updateEntity();
// get damage from falling
if (velocity.y > 0.0f) {
stopScreaming();
if (state == STATE_FAST_DIVE && velocity.y > 133.0f) {
hit(health + 1.0f, NULL, TR::HIT_FALL);
} else {
@@ -1881,6 +1882,11 @@ struct Lara : Character {
return STAND_AIR;
}
void stopScreaming() {
if (velocity.y >= 154.0f)
Sound::stop(TR::SND_SCREAM);
}
virtual int getHeight() {
if (stand == STAND_GROUND || stand == STAND_AIR)
return 768;