Skip to content

Commit

Permalink
Mark the PushSound property as meta
Browse files Browse the repository at this point in the history
  • Loading branch information
UnizoneDev authored and coelckers committed Nov 13, 2022
1 parent b664334 commit a21d0c7
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/namedef_custom.h
Expand Up @@ -526,6 +526,7 @@ xx(ExplosionDamage)
xx(ExplosionRadius)
xx(DontHurtShooter)
xx(Noattack)
xx(PushSound)

//xx(X)
//xx(Y)
Expand Down
1 change: 0 additions & 1 deletion src/playsim/actor.h
Expand Up @@ -1240,7 +1240,6 @@ class AActor final : public DThinker
FSoundIDNoInit BounceSound;
FSoundIDNoInit WallBounceSound;
FSoundIDNoInit CrushPainSound;
FSoundIDNoInit PushSound; // [UZ] Sound to play when an actor is being pushed around.

double MaxDropOffHeight;
double MaxStepHeight;
Expand Down
2 changes: 1 addition & 1 deletion src/playsim/p_acs.cpp
Expand Up @@ -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;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/playsim/p_mobj.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}
}

Expand Down
1 change: 0 additions & 1 deletion src/scripting/vmthunks_actors.cpp
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/zscript/actors/actor.zs
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a21d0c7

Please sign in to comment.