Mark the PushSound property as meta

This commit is contained in:
UnizoneDev 2022-11-12 05:35:55 -06:00 committed by Christoph Oelckers
parent b66433478c
commit a21d0c70e4
6 changed files with 6 additions and 7 deletions

View file

@ -526,6 +526,7 @@ xx(ExplosionDamage)
xx(ExplosionRadius)
xx(DontHurtShooter)
xx(Noattack)
xx(PushSound)
//xx(X)
//xx(Y)

View file

@ -1240,7 +1240,6 @@ public:
FSoundIDNoInit BounceSound;
FSoundIDNoInit WallBounceSound;
FSoundIDNoInit CrushPainSound;
FSoundIDNoInit PushSound; // [UZ] Sound to play when an actor is being pushed around.
double MaxDropOffHeight;
double MaxStepHeight;

View file

@ -4672,7 +4672,7 @@ static FSoundID GetActorSound(AActor *actor, int soundtype)
case SOUND_WallBounce: return actor->WallBounceSound;
case SOUND_CrushPain: return actor->CrushPainSound;
case SOUND_Howl: return actor->SoundVar(NAME_HowlSound);
case SOUND_Push: return actor->PushSound;
case SOUND_Push: return actor->SoundVar(NAME_PushSound);
default: return 0;
}
}

View file

@ -280,7 +280,6 @@ void AActor::Serialize(FSerializer &arc)
A("bouncesound", BounceSound)
A("wallbouncesound", WallBounceSound)
A("crushpainsound", CrushPainSound)
A("pushsound", PushSound)
A("speed", Speed)
A("floatspeed", FloatSpeed)
A("mass", Mass)
@ -3316,9 +3315,10 @@ DEFINE_ACTION_FUNCTION(AActor, PlayActiveSound)
void AActor::PlayPushSound()
{
if (PushSound && !S_IsActorPlayingSomething(this, CHAN_VOICE, -1))
FSoundID push = SoundVar(NAME_PushSound);
if (!S_IsActorPlayingSomething(this, CHAN_BODY, push))
{
S_Sound(this, CHAN_VOICE, 0, PushSound, 1, ATTN_IDLE);
S_Sound(this, CHAN_BODY, 0, push, 1, ATTN_NORM);
}
}

View file

@ -1992,7 +1992,6 @@ DEFINE_FIELD(AActor, UseSound)
DEFINE_FIELD(AActor, BounceSound)
DEFINE_FIELD(AActor, WallBounceSound)
DEFINE_FIELD(AActor, CrushPainSound)
DEFINE_FIELD(AActor, PushSound)
DEFINE_FIELD(AActor, MaxDropOffHeight)
DEFINE_FIELD(AActor, MaxStepHeight)
DEFINE_FIELD(AActor, MaxSlopeSteepness)

View file

@ -227,7 +227,6 @@ class Actor : Thinker native
native sound BounceSound;
native sound WallBounceSound;
native sound CrushPainSound;
native sound PushSound;
native double MaxDropoffHeight;
native double MaxStepHeight;
native double MaxSlopeSteepness;
@ -279,6 +278,7 @@ class Actor : Thinker native
meta double MissileHeight;
meta Name MissileName;
meta double FastSpeed; // speed in fast mode
meta Sound PushSound; // Sound being played when pushed by something
// todo: implement access to native meta properties.
// native meta int infighting_group;