mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-02-07 21:51:02 +00:00
- 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. SVN r2915 (trunk)
This commit is contained in:
parent
62f846b0ab
commit
ec3e4bb7c7
2 changed files with 38 additions and 21 deletions
|
@ -452,6 +452,25 @@ int DIntermissionScreenCast::Responder (event_t *ev)
|
||||||
return true;
|
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 ()
|
int DIntermissionScreenCast::Ticker ()
|
||||||
{
|
{
|
||||||
Super::Ticker();
|
Super::Ticker();
|
||||||
|
@ -465,26 +484,13 @@ int DIntermissionScreenCast::Ticker ()
|
||||||
}
|
}
|
||||||
else
|
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
|
// just advance to next state in animation
|
||||||
if (caststate == advplayerstate)
|
if (caststate == advplayerstate)
|
||||||
goto stopattack; // Oh, gross hack!
|
goto stopattack; // Oh, gross hack!
|
||||||
|
|
||||||
caststate = caststate->GetNextState();
|
caststate = caststate->GetNextState();
|
||||||
|
|
||||||
|
PlayAttackSound();
|
||||||
castframes++;
|
castframes++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -492,18 +498,27 @@ int DIntermissionScreenCast::Ticker ()
|
||||||
{
|
{
|
||||||
// go into attack frame
|
// go into attack frame
|
||||||
castattacking = true;
|
castattacking = true;
|
||||||
if (castonmelee)
|
if (!mClass->IsDescendantOf(RUNTIME_CLASS(APlayerPawn)))
|
||||||
basestate = caststate = mDefaults->MeleeState;
|
|
||||||
else
|
|
||||||
basestate = caststate = mDefaults->MissileState;
|
|
||||||
castonmelee ^= 1;
|
|
||||||
if (caststate == NULL)
|
|
||||||
{
|
{
|
||||||
if (castonmelee)
|
if (castonmelee)
|
||||||
basestate = caststate = mDefaults->MeleeState;
|
basestate = caststate = mDefaults->MeleeState;
|
||||||
else
|
else
|
||||||
basestate = caststate = mDefaults->MissileState;
|
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)
|
if (castattacking)
|
||||||
|
|
|
@ -243,6 +243,8 @@ class DIntermissionScreenCast : public DIntermissionScreen
|
||||||
int castframes;
|
int castframes;
|
||||||
int castonmelee;
|
int castonmelee;
|
||||||
|
|
||||||
|
void PlayAttackSound();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DIntermissionScreenCast() {}
|
DIntermissionScreenCast() {}
|
||||||
|
|
Loading…
Reference in a new issue