From 1ec6c3625b4ed44d49accdd5f95d6ddede14ca67 Mon Sep 17 00:00:00 2001 From: gez Date: Fri, 25 Nov 2011 15:02:57 +0000 Subject: [PATCH] * Updated to ZDoom r3319: - Fixed: Cht_ChangeLevel cheats should not check for disabled cheats. - Added SMF_CURSPEED flag for A_SeekerMissile to cause it to use the missile's current speed rather than its Speed property. - Initialize all parameters when converting MBF_PlaySound to A_PlaySound, because volume was being passed as 0 to A_PlaySound. - Fix: Use correct pickup flash color. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1265 b0f79afe-0144-0410-b225-9a4edf0717df --- src/d_dehacked.cpp | 7 +++++-- src/p_local.h | 2 +- src/p_mobj.cpp | 18 +++++++++++------- src/st_stuff.cpp | 8 ++++---- src/svnrevision.h | 4 ++-- src/thingdef/thingdef_codeptr.cpp | 3 ++- wadsrc/static/actors/constants.txt | 1 + wadsrc/static/mapinfo/chex.txt | 2 +- 8 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index 16dc5b51..5f93be98 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -691,8 +691,11 @@ void SetDehParams(FState * state, int codepointer) if (value2) StateParams.Set(ParamIndex+1, new FxConstant(SoundMap[value2-1], *pos)); // hit sound break; case MBF_PlaySound: - StateParams.Set(ParamIndex+0, new FxConstant(SoundMap[value1-1], *pos)); // soundid - StateParams.Set(ParamIndex+4, new FxConstant((value2?ATTN_NONE:ATTN_NORM), *pos)); // attenuation + StateParams.Set(ParamIndex+0, new FxConstant(SoundMap[value1-1], *pos)); // soundid + StateParams.Set(ParamIndex+1, new FxConstant(CHAN_BODY, *pos)); // channel + StateParams.Set(ParamIndex+2, new FxConstant(1.0, *pos)); // volume + StateParams.Set(ParamIndex+3, new FxConstant(false, *pos)); // looping + StateParams.Set(ParamIndex+4, new FxConstant((value2 ? ATTN_NONE : ATTN_NORM), *pos)); // attenuation break; case MBF_RandomJump: StateParams.Set(ParamIndex+0, new FxConstant(2, *pos)); // count diff --git a/src/p_local.h b/src/p_local.h index 3c3040e6..879a876a 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -97,7 +97,7 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer=false); void P_ThrustMobj (AActor *mo, angle_t angle, fixed_t move); int P_FaceMobj (AActor *source, AActor *target, angle_t *delta); -bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool precise = false); +bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool precise = false, bool usecurspeed=false); enum EPuffFlags { diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index c77128a2..10577262 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -1468,16 +1468,18 @@ bool AActor::CanSeek(AActor *target) const // //---------------------------------------------------------------------------- -bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool precise) +bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool precise, bool usecurspeed) { int dir; int dist; angle_t delta; angle_t angle; AActor *target; + fixed_t speed; + speed = !usecurspeed ? actor->Speed : xs_CRoundToInt(TVector3(actor->velx, actor->vely, actor->velz).Length()); target = actor->tracer; - if (target == NULL || actor->Speed == 0 || !actor->CanSeek(target)) + if (target == NULL || speed == 0 || !actor->CanSeek(target)) { return false; } @@ -1507,8 +1509,8 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool preci if (!precise) { - actor->velx = FixedMul (actor->Speed, finecosine[angle]); - actor->vely = FixedMul (actor->Speed, finesine[angle]); + actor->velx = FixedMul (speed, finecosine[angle]); + actor->vely = FixedMul (speed, finesine[angle]); if (!(actor->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))) { @@ -1516,7 +1518,7 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool preci target->z + target->height < actor->z) { // Need to seek vertically dist = P_AproxDistance (target->x - actor->x, target->y - actor->y); - dist = dist / actor->Speed; + dist = dist / speed; if (dist < 1) { dist = 1; @@ -1541,8 +1543,8 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool preci pitch >>= ANGLETOFINESHIFT; } - fixed_t xyscale = FixedMul(actor->Speed, finecosine[pitch]); - actor->velz = FixedMul(actor->Speed, finesine[pitch]); + fixed_t xyscale = FixedMul(speed, finecosine[pitch]); + actor->velz = FixedMul(speed, finesine[pitch]); actor->velx = FixedMul(xyscale, finecosine[angle]); actor->vely = FixedMul(xyscale, finesine[angle]); } @@ -1872,6 +1874,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly) } + // Reflect the missile along angle mo->angle = angle; angle >>= ANGLETOFINESHIFT; @@ -2468,6 +2471,7 @@ void P_NightmareRespawn (AActor *mobj) z = mo->z; + // inherit attributes from deceased one mo->SpawnPoint[0] = mobj->SpawnPoint[0]; mo->SpawnPoint[1] = mobj->SpawnPoint[1]; diff --git a/src/st_stuff.cpp b/src/st_stuff.cpp index 08e6f0be..bbfad744 100644 --- a/src/st_stuff.cpp +++ b/src/st_stuff.cpp @@ -193,7 +193,7 @@ static cheatseq_t DoomCheats[] = { CheatPowerup[4], 0, 0, 0, {CHT_BEHOLDA,0}, Cht_Generic }, { CheatPowerup[5], 0, 0, 0, {CHT_BEHOLDL,0}, Cht_Generic }, { CheatChoppers, 0, 0, 0, {CHT_CHAINSAW,0}, Cht_Generic }, - { CheatClev, 0, 0, 0, {0,0}, Cht_ChangeLevel } + { CheatClev, 0, 1, 0, {0,0}, Cht_ChangeLevel } }; static cheatseq_t HereticCheats[] = @@ -211,7 +211,7 @@ static cheatseq_t HereticCheats[] = { CheatAmmo, 0, 0, 0, {CHT_TAKEWEAPS,0}, Cht_Generic }, { CheatGod, 0, 0, 0, {CHT_NOWUDIE,0}, Cht_Generic }, { CheatMassacre, 0, 0, 0, {CHT_MASSACRE,0}, Cht_Generic }, - { CheatEngage, 0, 0, 0, {0,0}, Cht_ChangeLevel }, + { CheatEngage, 0, 1, 0, {0,0}, Cht_ChangeLevel }, { CheatPowerup1[0], 0, 0, 0, {CHT_GIMMIEA,0}, Cht_Generic }, { CheatPowerup1[1], 0, 0, 0, {CHT_GIMMIEB,0}, Cht_Generic }, { CheatPowerup1[2], 0, 0, 0, {CHT_GIMMIEC,0}, Cht_Generic }, @@ -262,7 +262,7 @@ static cheatseq_t StrifeCheats[] = { CheatPowerup2[4], 0, 0, 0, {CHT_PUMPUPP,0}, Cht_Generic }, { CheatPowerup2[5], 0, 0, 0, {CHT_PUMPUPS,0}, Cht_Generic }, { CheatPowerup2[6], 0, 0, 0, {CHT_PUMPUPT,0}, Cht_Generic }, - { CheatRift, 0, 0, 0, {0,0}, Cht_ChangeLevel }, + { CheatRift, 0, 1, 0, {0,0}, Cht_ChangeLevel }, { CheatDonnyTrump, 0, 0, 0, {CHT_DONNYTRUMP,0},Cht_Generic }, { CheatScoot, 0, 0, 0, {0,0}, Cht_ChangeStartSpot }, { CheatLego, 0, 0, 0, {CHT_LEGO,0}, Cht_Generic }, @@ -284,7 +284,7 @@ static cheatseq_t ChexCheats[] = { CheatDigitalCafe, 0, 0, 0, {CHT_BEHOLDA,0}, Cht_Generic }, { CheatJoshuaStorms, 0, 0, 0, {CHT_BEHOLDL,0}, Cht_Generic }, { CheatJoelKoenigs, 0, 0, 0, {CHT_CHAINSAW,0}, Cht_Generic }, - { CheatLeeSnyder, 0, 0, 0, {0,0}, Cht_ChangeLevel } + { CheatLeeSnyder, 0, 1, 0, {0,0}, Cht_ChangeLevel } }; static cheatseq_t SpecialCheats[] = diff --git a/src/svnrevision.h b/src/svnrevision.h index 4bb30970..a7713639 100644 --- a/src/svnrevision.h +++ b/src/svnrevision.h @@ -3,5 +3,5 @@ // This file was automatically generated by the // updaterevision tool. Do not edit by hand. -#define ZD_SVN_REVISION_STRING "3315" -#define ZD_SVN_REVISION_NUMBER 3315 +#define ZD_SVN_REVISION_STRING "3319" +#define ZD_SVN_REVISION_NUMBER 3319 diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 965d4de0..c2651072 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -487,6 +487,7 @@ enum { SMF_LOOK = 1, SMF_PRECISE = 2, + SMF_CURSPEED = 4, }; DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SeekerMissile) { @@ -501,7 +502,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SeekerMissile) { self->tracer = P_RoughMonsterSearch (self, distance); } - P_SeekerMissile(self, clamp(ang1, 0, 90) * ANGLE_1, clamp(ang2, 0, 90) * ANGLE_1, !!(flags & SMF_PRECISE)); + P_SeekerMissile(self, clamp(ang1, 0, 90) * ANGLE_1, clamp(ang2, 0, 90) * ANGLE_1, !!(flags & SMF_PRECISE), !!(flags & SMF_CURSPEED)); } //========================================================================== diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index fa8f37e9..fe84014e 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -124,6 +124,7 @@ const int BF_AFFECTBOSSES = 4; // Flags for A_SeekerMissile const int SMF_LOOK = 1; const int SMF_PRECISE = 2; +const int SMF_CURSPEED = 4; // Flags for A_CustomPunch const int CPF_USEAMMO = 1; diff --git a/wadsrc/static/mapinfo/chex.txt b/wadsrc/static/mapinfo/chex.txt index acc4462b..edc5b4f2 100644 --- a/wadsrc/static/mapinfo/chex.txt +++ b/wadsrc/static/mapinfo/chex.txt @@ -43,7 +43,7 @@ gameinfo endoom = "ENDOOM" player5start = 4001 drawreadthis = true - pickupcolor = "d6 ba 45" + pickupcolor = "d7 ba 45" quitmessages = "$QUITMSG", "$QUITMSG23", "$QUITMSG24", "$QUITMSG25", "$QUITMSG26", "$QUITMSG27", "$QUITMSG28", "$QUITMSG29" menufontcolor_title = "GREEN" menufontcolor_label = "UNTRANSLATED"