- scriptified the sector actions.
This commit is contained in:
parent
3b7d18c129
commit
d338ca3ec1
13 changed files with 141 additions and 187 deletions
|
|
@ -2457,45 +2457,3 @@ void S_ParseMusInfo()
|
|||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Music changer. Uses the sector action class to do its job
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
class AMusicChanger : public ASectorAction
|
||||
{
|
||||
DECLARE_CLASS (AMusicChanger, ASectorAction)
|
||||
public:
|
||||
virtual bool DoTriggerAction (AActor *triggerer, int activationType);
|
||||
virtual void PostBeginPlay();
|
||||
};
|
||||
|
||||
IMPLEMENT_CLASS(AMusicChanger, false, false)
|
||||
|
||||
bool AMusicChanger::DoTriggerAction (AActor *triggerer, int activationType)
|
||||
{
|
||||
if (activationType & SECSPAC_Enter && triggerer->player != NULL)
|
||||
{
|
||||
if (triggerer->player->MUSINFOactor != this)
|
||||
{
|
||||
triggerer->player->MUSINFOactor = this;
|
||||
triggerer->player->MUSINFOtics = 30;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void AMusicChanger::PostBeginPlay()
|
||||
{
|
||||
// The music changer should consider itself activated if the player
|
||||
// spawns in its sector as well as if it enters the sector during a P_TryMove.
|
||||
Super::PostBeginPlay();
|
||||
for (int i = 0; i < MAXPLAYERS; ++i)
|
||||
{
|
||||
if (playeringame[i] && players[i].mo && players[i].mo->Sector == this->Sector)
|
||||
{
|
||||
DoTriggerAction(players[i].mo, SECSPAC_Enter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue