diff --git a/docs/rh-log.txt b/docs/rh-log.txt index dd400946c..98706cc64 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,7 @@ -June 6, 2009 +June 7, 2009 (Changes by Graf Zahl) +- Added Karate Chris's poison cloud fix. + +June 6, 2009 - Added per-tier texture scaling with these new UDMF sidedef properties: * scalex_top * scaley_top diff --git a/src/g_hexen/a_flechette.cpp b/src/g_hexen/a_flechette.cpp index 3c120d87c..ce33a1895 100644 --- a/src/g_hexen/a_flechette.cpp +++ b/src/g_hexen/a_flechette.cpp @@ -274,9 +274,10 @@ int APoisonCloud::DoSpecialDamage (AActor *victim, int damage) { P_PoisonDamage (victim->player, this, 15+(pr_poisoncloudd()&15), false); // Don't play painsound - P_PoisonPlayer (victim->player, this, this->target, 50); - S_Sound (victim, CHAN_VOICE, "*poison", 1, ATTN_NORM); + // If successful, play the posion sound. + if (P_PoisonPlayer (victim->player, this, this->target, 50)) + S_Sound (victim, CHAN_VOICE, "*poison", 1, ATTN_NORM); } } return -1; diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 9bcadd15b..6ec5bdccb 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1388,11 +1388,11 @@ bool AActor::OkayToSwitchTarget (AActor *other) // //========================================================================== -void P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poison) +bool P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poison) { if((player->cheats&CF_GODMODE) || (player->mo->flags2 & MF2_INVULNERABLE)) { - return; + return false; } if (source != NULL && source->player != player && player->mo->IsTeammate (source)) { @@ -1407,6 +1407,7 @@ void P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poi player->poisoncount = 100; } } + return true; } //========================================================================== @@ -1490,6 +1491,7 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage, P_SetMobjState(target, target->info->painstate); } */ + return; } bool CheckCheatmode (); diff --git a/src/p_local.h b/src/p_local.h index 5ccf305a1..d0cae7f4e 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -449,7 +449,7 @@ extern FBlockNode** blocklinks; // for thing chains void P_TouchSpecialThing (AActor *special, AActor *toucher); void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, FName mod, int flags=0); bool P_GiveBody (AActor *actor, int num); -void P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poison); +bool P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poison); void P_PoisonDamage (player_t *player, AActor *source, int damage, bool playPainSound); enum EDmgFlags