From 385350efae09df9a700baf5be3f42283c5c57e0f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 12 Aug 2009 18:57:31 +0000 Subject: [PATCH] - Fixed: A_SorcOffense2 depended on args being bytes and overflowing. - Fixed: Even though P_DamageMobj checked an attack's originator for MF2_NODMGTHRUST the same check was missing from P_RadiusAttack. - Fixed: A_MinotaurRoam should not assume without check that it was called by a MinotaurFriend. - Fixed: The Minotaur declared A_MntrFloorFire which it did not use. - Fixed: All Spawnspot functions did not check for a spot tid of 0 as the script's activator. - Fixed: Friendly monsters ignored team association of their owning players. SVN r1770 (trunk) --- docs/rh-log.txt | 16 +++++++++-- src/g_hexen/a_heresiarch.cpp | 2 +- src/g_raven/a_minotaur.cpp | 29 ++++++++++--------- src/g_strife/a_acolyte.cpp | 4 +-- src/p_acs.cpp | 32 +++++++++++++++------ src/p_acs.h | 4 +-- src/p_map.cpp | 37 +++++++++++++------------ src/p_mobj.cpp | 6 ++-- wadsrc/static/actors/raven/minotaur.txt | 1 - 9 files changed, 83 insertions(+), 48 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 2bfd67b84..93ec71a8c 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,16 @@ -August 11, 2009 (Changes by Graf Zahl) +August 12, 2009 (Changes by Graf Zahl) +- Fixed: A_SorcOffense2 depended on args being bytes and overflowing. +- Fixed: Even though P_DamageMobj checked an attack's originator + for MF2_NODMGTHRUST the same check was missing from P_RadiusAttack. +- Fixed: A_MinotaurRoam should not assume without check that it was + called by a MinotaurFriend. +- Fixed: The Minotaur declared A_MntrFloorFire which it did not use. +- Fixed: All Spawnspot functions did not check for a spot tid of 0 as + the script's activator. +- Fixed: Friendly monsters ignored team association of their owning + players. + +August 11, 2009 (Changes by Graf Zahl) - Fixed: The pause sprite was not centered correctly when it was a scaled graphic. @@ -98,7 +110,7 @@ August 2, 2009 (Changes by Graf Zahl) Misc1 variable were needed. August 1, 2009 -- Moved the terget->velz assignment to the end of A_VileAttack to remove the +- Moved the target->velz assignment to the end of A_VileAttack to remove the influence of vertical thrust from the radius attack, since ZDoom does explosions in three dimensions, but Doom only did it in two. - Fixed: The last three parameters to A_VileAttack had their references off diff --git a/src/g_hexen/a_heresiarch.cpp b/src/g_hexen/a_heresiarch.cpp index a27b56e97..2107f2722 100644 --- a/src/g_hexen/a_heresiarch.cpp +++ b/src/g_hexen/a_heresiarch.cpp @@ -657,7 +657,7 @@ void A_SorcOffense2(AActor *actor) } index = actor->args[4] << 5; - actor->args[4] += 15; + actor->args[4] = (actor->args[4] + 15) & 255; delta = (finesine[index])*SORCFX4_SPREAD_ANGLE; delta = (delta>>FRACBITS)*ANGLE_1; ang1 = actor->angle + delta; diff --git a/src/g_raven/a_minotaur.cpp b/src/g_raven/a_minotaur.cpp index 747ee6be1..3dc9e141a 100644 --- a/src/g_raven/a_minotaur.cpp +++ b/src/g_raven/a_minotaur.cpp @@ -464,34 +464,37 @@ void P_MinotaurSlam (AActor *source, AActor *target) DEFINE_ACTION_FUNCTION(AActor, A_MinotaurRoam) { - AMinotaurFriend *self1 = static_cast (self); - // In case pain caused him to skip his fade in. - self1->RenderStyle = STYLE_Normal; + self->RenderStyle = STYLE_Normal; - if (self1->StartTime >= 0 && (level.maptime - self1->StartTime) >= MAULATORTICS) + if (self->IsKindOf(RUNTIME_CLASS(AMinotaurFriend))) { - P_DamageMobj (self1, NULL, NULL, TELEFRAG_DAMAGE, NAME_None); - return; + AMinotaurFriend *self1 = static_cast (self); + + if (self1->StartTime >= 0 && (level.maptime - self1->StartTime) >= MAULATORTICS) + { + P_DamageMobj (self1, NULL, NULL, TELEFRAG_DAMAGE, NAME_None); + return; + } } if (pr_minotaurroam() < 30) - CALL_ACTION(A_MinotaurLook, self1); // adjust to closest target + CALL_ACTION(A_MinotaurLook, self); // adjust to closest target if (pr_minotaurroam() < 6) { //Choose new direction - self1->movedir = pr_minotaurroam() % 8; - FaceMovementDirection (self1); + self->movedir = pr_minotaurroam() % 8; + FaceMovementDirection (self); } - if (!P_Move(self1)) + if (!P_Move(self)) { // Turn if (pr_minotaurroam() & 1) - self1->movedir = (++self1->movedir)%8; + self->movedir = (++self->movedir)%8; else - self1->movedir = (self1->movedir+7)%8; - FaceMovementDirection (self1); + self->movedir = (self->movedir+7)%8; + FaceMovementDirection (self); } } diff --git a/src/g_strife/a_acolyte.cpp b/src/g_strife/a_acolyte.cpp index 72f1cd0d1..6785de1ac 100644 --- a/src/g_strife/a_acolyte.cpp +++ b/src/g_strife/a_acolyte.cpp @@ -72,8 +72,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_AcolyteDie) } } - players[0].mo->GiveInventoryType (QuestItemClasses[6]); - players[0].SetLogNumber (14); + players[i].mo->GiveInventoryType (QuestItemClasses[6]); + players[i].SetLogNumber (14); S_StopSound (CHAN_VOICE); S_Sound (CHAN_VOICE, "svox/voc14", 1, ATTN_NORM); } diff --git a/src/p_acs.cpp b/src/p_acs.cpp index fe5111c80..1a7d9575b 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -2276,26 +2276,42 @@ int DLevelScript::DoSpawn (int type, fixed_t x, fixed_t y, fixed_t z, int tid, i int DLevelScript::DoSpawnSpot (int type, int spot, int tid, int angle, bool force) { - FActorIterator iterator (spot); - AActor *aspot; int spawned = 0; - while ( (aspot = iterator.Next ()) ) + if (spot != 0) { - spawned += DoSpawn (type, aspot->x, aspot->y, aspot->z, tid, angle, force); + FActorIterator iterator (spot); + AActor *aspot; + + while ( (aspot = iterator.Next ()) ) + { + spawned += DoSpawn (type, aspot->x, aspot->y, aspot->z, tid, angle, force); + } + } + else if (activator != NULL) + { + spawned += DoSpawn (type, activator->x, activator->y, activator->z, tid, angle, force); } return spawned; } int DLevelScript::DoSpawnSpotFacing (int type, int spot, int tid, bool force) { - FActorIterator iterator (spot); - AActor *aspot; int spawned = 0; - while ( (aspot = iterator.Next ()) ) + if (spot != 0) { - spawned += DoSpawn (type, aspot->x, aspot->y, aspot->z, tid, aspot->angle >> 24, force); + FActorIterator iterator (spot); + AActor *aspot; + + while ( (aspot = iterator.Next ()) ) + { + spawned += DoSpawn (type, aspot->x, aspot->y, aspot->z, tid, aspot->angle >> 24, force); + } + } + else if (activator != NULL) + { + spawned += DoSpawn (type, activator->x, activator->y, activator->z, tid, activator->angle >> 24, force); } return spawned; } diff --git a/src/p_acs.h b/src/p_acs.h index 7e4777a46..c57af5793 100644 --- a/src/p_acs.h +++ b/src/p_acs.h @@ -713,8 +713,8 @@ protected: static void SetLineTexture (int lineid, int side, int position, int name); static void ReplaceTextures (int fromname, int toname, int flags); static int DoSpawn (int type, fixed_t x, fixed_t y, fixed_t z, int tid, int angle, bool force); - static int DoSpawnSpot (int type, int spot, int tid, int angle, bool forced); - static int DoSpawnSpotFacing (int type, int spot, int tid, bool forced); + int DoSpawnSpot (int type, int spot, int tid, int angle, bool forced); + int DoSpawnSpotFacing (int type, int spot, int tid, bool forced); int DoClassifyActor (int tid); int CallFunction(int argCount, int funcIndex, SDWORD *args); diff --git a/src/p_map.cpp b/src/p_map.cpp index 595f2bad2..c7fd8c7ef 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4064,25 +4064,28 @@ void P_RadiusAttack (AActor *bombspot, AActor *bombsource, int bombdamage, int b if (!bombdodamage || !(bombspot->flags2 & MF2_NODMGTHRUST)) { - thrust = points * 0.5f / (float)thing->Mass; - if (bombsource == thing) + if (bombsource == NULL || !(bombsource->flags2 & MF2_NODMGTHRUST)) { - thrust *= selfthrustscale; + thrust = points * 0.5f / (float)thing->Mass; + if (bombsource == thing) + { + thrust *= selfthrustscale; + } + velz = (float)(thing->z + (thing->height>>1) - bombspot->z) * thrust; + if (bombsource != thing) + { + velz *= 0.5f; + } + else + { + velz *= 0.8f; + } + angle_t ang = R_PointToAngle2 (bombspot->x, bombspot->y, thing->x, thing->y) >> ANGLETOFINESHIFT; + thing->velx += fixed_t (finecosine[ang] * thrust); + thing->vely += fixed_t (finesine[ang] * thrust); + if (bombdodamage) + thing->velz += (fixed_t)velz; // this really doesn't work well } - velz = (float)(thing->z + (thing->height>>1) - bombspot->z) * thrust; - if (bombsource != thing) - { - velz *= 0.5f; - } - else - { - velz *= 0.8f; - } - angle_t ang = R_PointToAngle2 (bombspot->x, bombspot->y, thing->x, thing->y) >> ANGLETOFINESHIFT; - thing->velx += fixed_t (finecosine[ang] * thrust); - thing->vely += fixed_t (finesine[ang] * thrust); - if (bombdodamage) - thing->velz += (fixed_t)velz; // this really doesn't work well } } } diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index a990dd8c7..7dc874317 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -5160,7 +5160,8 @@ bool AActor::IsFriend (AActor *other) return !deathmatch || FriendPlayer == other->FriendPlayer || FriendPlayer == 0 || - other->FriendPlayer == 0; + other->FriendPlayer == 0 || + players[FriendPlayer-1].mo->IsTeammate(players[other->FriendPlayer-1].mo); } return false; } @@ -5184,7 +5185,8 @@ bool AActor::IsHostile (AActor *other) return deathmatch && FriendPlayer != other->FriendPlayer && FriendPlayer !=0 && - other->FriendPlayer != 0; + other->FriendPlayer != 0 && + !players[FriendPlayer-1].mo->IsTeammate(players[other->FriendPlayer-1].mo); } return true; } diff --git a/wadsrc/static/actors/raven/minotaur.txt b/wadsrc/static/actors/raven/minotaur.txt index 64a5fee9f..edce0d813 100644 --- a/wadsrc/static/actors/raven/minotaur.txt +++ b/wadsrc/static/actors/raven/minotaur.txt @@ -29,7 +29,6 @@ ACTOR Minotaur 9 native action native A_MinotaurAtk2(); action native A_MinotaurAtk3(); action native A_MinotaurCharge(); - action native A_MntrFloorFire(); action native A_MinotaurLook(); action native A_MinotaurRoam(); action native A_MinotaurChase();