From ba61c60d52544222c54082becc7097d9d3b3808a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 19 Nov 2007 08:13:23 +0000 Subject: [PATCH] - Fixed: When the DONTMOVE flag for A_Chase was used, movecount was not decreased resulting in missile attacks not working. - Fixed: Hitscan attacks used the puff's position to calculate the trajectory for weapon kickback. SVN r568 (trunk) --- docs/rh-log.txt | 10 ++++++++++ src/g_level.cpp | 15 ++++++++------- src/p_enemy.cpp | 1 + src/p_interaction.cpp | 6 ++++-- src/p_local.h | 3 ++- src/p_map.cpp | 2 +- 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 050b5f72d..806a15600 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,13 @@ +November 18, 2007 (Changes by Graf Zahl) +- Fixed TableShit0 definition. + +November 13, 2007 (Changes by Graf Zahl) +- Fixed Berserk pickup sound. +- Fixed: When the DONTMOVE flag for A_Chase was used, movecount was not decreased + resulting in missile attacks not working. +- Fixed: Hitscan attacks used the puff's position to calculate the trajectory for + weapon kickback. + November 11, 2007 (Changes by Graf Zahl) - Fixed: The FMOD stream player must specify whether it wants to play the sound looped or not when playback is started, not when the stream is created. diff --git a/src/g_level.cpp b/src/g_level.cpp index 55e63d564..d5c9ff5c7 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1717,16 +1717,17 @@ void G_ExitLevel (int position, bool keepFacing) void G_SecretExitLevel (int position) { - const char *nextmap; + const char *nextmap = level.nextmap; - MapData * map = P_OpenMapData(level.secretmap); - if (map != NULL) + if (level.secretmap[0] != 0) { - delete map; - nextmap = level.secretmap; + MapData * map = P_OpenMapData(level.secretmap); + if (map != NULL) + { + delete map; + nextmap = level.secretmap; + } } - else - nextmap = level.nextmap; G_ChangeLevel(nextmap, position, false); } diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 0079c6449..b1e2508f1 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -2084,6 +2084,7 @@ void A_DoChase (AActor *actor, bool fastchase, FState *meleestate, FState *missi P_NewChaseDir (actor); } } + else if (dontmove && actor->movecount > 0) actor->movecount--; // make active sound if (playactive && pr_chase() < 3) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index edd430ede..e7d968e30 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -948,7 +948,9 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage if (kickback) { - ang = R_PointToAngle2 (inflictor->x, inflictor->y, + AActor *origin = (source && (flags & DMG_INFLICTOR_IS_PUFF))? source : inflictor; + + ang = R_PointToAngle2 (origin->x, origin->y, target->x, target->y); thrust = damage*(FRACUNIT>>3)*kickback / target->Mass; // [RH] If thrust overflows, use a more reasonable amount @@ -958,7 +960,7 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage } // make fall forwards sometimes if ((damage < 40) && (damage > target->health) - && (target->z - inflictor->z > 64*FRACUNIT) + && (target->z - origin->z > 64*FRACUNIT) && (pr_damagemobj()&1) // [RH] But only if not too fast and not flying && thrust < 10*FRACUNIT diff --git a/src/p_local.h b/src/p_local.h index 006b8a166..1b9316d27 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -356,7 +356,8 @@ bool P_MorphPlayer (player_t *player, const PClass *morphClass); void P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poison); void P_PoisonDamage (player_t *player, AActor *source, int damage, bool playPainSound); -#define DMG_NO_ARMOR 1 +#define DMG_NO_ARMOR 1 +#define DMG_INFLICTOR_IS_PUFF 2 // ===== PO_MAN ===== diff --git a/src/p_map.cpp b/src/p_map.cpp index 665c72824..c83bf1ca3 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -2922,7 +2922,7 @@ void P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, } if (damage) { - int flags = 0; + int flags = DMG_INFLICTOR_IS_PUFF; // Allow MF5_PIERCEARMOR on a weapon as well. if (t1->player != NULL && t1->player->ReadyWeapon != NULL && t1->player->ReadyWeapon->flags5 & MF5_PIERCEARMOR)