* Updated to ZDoom r2915:

- Fixed: The Player played no sounds in the Doom2 cast.
- Fixed: The player's melee state is not a proper melee state so it should not be entered when used in the cast.
- Fixed: Sounds were played before changing states. That missed situations where the state was entered from anywhere else but the previous state.
- Fixed: The Lost Soul used the wrong sound in the cast call.

git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1026 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
gez 2010-10-06 18:41:23 +00:00
parent 71e6229dc1
commit f51294d109
4 changed files with 41 additions and 24 deletions

View file

@ -452,6 +452,25 @@ int DIntermissionScreenCast::Responder (event_t *ev)
return true;
}
void DIntermissionScreenCast::PlayAttackSound()
{
// sound hacks....
if (caststate != NULL && castattacking)
{
for (unsigned i = 0; i < mCastSounds.Size(); i++)
{
if ((!!mCastSounds[i].mSequence) == (basestate != mDefaults->MissileState) &&
(caststate == basestate + mCastSounds[i].mIndex))
{
S_StopAllChannels ();
S_Sound (CHAN_WEAPON | CHAN_UI, mCastSounds[i].mSound, 1, ATTN_NONE);
return;
}
}
}
}
int DIntermissionScreenCast::Ticker ()
{
Super::Ticker();
@ -465,26 +484,13 @@ int DIntermissionScreenCast::Ticker ()
}
else
{
// sound hacks....
if (caststate != NULL && castattacking)
{
for (unsigned i = 0; i < mCastSounds.Size(); i++)
{
if ((!!mCastSounds[i].mSequence) == (basestate != mDefaults->MissileState) &&
(caststate == basestate + mCastSounds[i].mIndex - 1))
{
S_StopAllChannels ();
S_Sound (CHAN_WEAPON | CHAN_UI, mCastSounds[i].mSound, 1, ATTN_NONE);
break;
}
}
}
// just advance to next state in animation
if (caststate == advplayerstate)
goto stopattack; // Oh, gross hack!
caststate = caststate->GetNextState();
PlayAttackSound();
castframes++;
}
@ -492,18 +498,27 @@ int DIntermissionScreenCast::Ticker ()
{
// go into attack frame
castattacking = true;
if (castonmelee)
basestate = caststate = mDefaults->MeleeState;
else
basestate = caststate = mDefaults->MissileState;
castonmelee ^= 1;
if (caststate == NULL)
if (!mClass->IsDescendantOf(RUNTIME_CLASS(APlayerPawn)))
{
if (castonmelee)
basestate = caststate = mDefaults->MeleeState;
else
basestate = caststate = mDefaults->MissileState;
castonmelee ^= 1;
if (caststate == NULL)
{
if (castonmelee)
basestate = caststate = mDefaults->MeleeState;
else
basestate = caststate = mDefaults->MissileState;
}
}
else
{
// The players use the melee state differently so it can't be used here
basestate = caststate = mDefaults->MissileState;
}
PlayAttackSound();
}
if (castattacking)

View file

@ -243,6 +243,8 @@ class DIntermissionScreenCast : public DIntermissionScreen
int castframes;
int castonmelee;
void PlayAttackSound();
public:
DIntermissionScreenCast() {}

View file

@ -3,5 +3,5 @@
// This file was automatically generated by the
// updaterevision tool. Do not edit by hand.
#define ZD_SVN_REVISION_STRING "2911"
#define ZD_SVN_REVISION_NUMBER 2911
#define ZD_SVN_REVISION_STRING "2915"
#define ZD_SVN_REVISION_NUMBER 2915

View file

@ -177,7 +177,7 @@ Intermission Doom2Cast
{
CastClass = "LostSoul"
CastName = "$CC_LOST"
AttackSound = "Missile", 1, "grunt/attack"
AttackSound = "Missile", 1, "skull/melee"
}
Cast
{