From 2ad91cc973cecf3fa4f3bee84f40ae50d0191244 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 16 May 2006 17:53:15 +0000 Subject: [PATCH] - Added a missing NULL pointer check to APlayerPawn::Tick. - Fixed: The falling scream should not be played when the player is under water. SVN r120 (trunk) --- docs/rh-log.txt | 5 +++++ src/d_main.cpp | 1 - src/p_user.cpp | 7 ++++--- src/tarray.h | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 1d82617f4..552deacd5 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,8 @@ +May 16, 2006 (Changes by Graf Zahl) +- Added a missing NULL pointer check to APlayerPawn::Tick. +- Fixed: The falling scream should not be played when the player is under + water. + May 15, 2006 - Fixed: CopyPlayer() in p_saveg.cpp should use normal assignment, not memcpy to copy the player structures. diff --git a/src/d_main.cpp b/src/d_main.cpp index 837d5b892..c83300215 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -83,7 +83,6 @@ #include "gameconfigfile.h" #include "sbar.h" #include "decallib.h" -#include "version.h" #include "r_polymost.h" #include "version.h" #include "v_text.h" diff --git a/src/p_user.cpp b/src/p_user.cpp index e90e01765..d614a1227 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -279,7 +279,7 @@ void APlayerPawn::Tick() Super::Tick(); // Here's the place where crouching sprites should be handled - if (player->crouchfactorcrouchfactormo)); - if (player->mo->momz <= -35*FRACUNIT - && player->mo->momz >= -40*FRACUNIT && !player->morphTics) + if (player->mo->momz <= -35*FRACUNIT && + player->mo->momz >= -40*FRACUNIT && !player->morphTics && + player->mo->waterlevel == 0) { int id = S_FindSkinnedSound (player->mo, "*falling"); if (id != 0 && !S_GetSoundPlayingInfo (player->mo, id)) diff --git a/src/tarray.h b/src/tarray.h index a4cf7375d..9c2d8ac91 100644 --- a/src/tarray.h +++ b/src/tarray.h @@ -130,7 +130,7 @@ public: if (index < Count) { Array[index].~T(); - memmove (&Array[index], &Array[index+1], Count - index - 1); + memmove (&Array[index], &Array[index+1], sizeof(T)*(Count - index - 1)); Count--; } }