Merge remote-tracking branch 'gzdoom/master' into newmaster

This commit is contained in:
Major Cooke 2019-12-17 09:03:05 -06:00
commit 4eb1b6ad95
5 changed files with 7 additions and 7 deletions

View file

@ -189,7 +189,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, A_StartSound, A_StartSound)
return 0; return 0;
} }
DEFINE_ACTION_FUNCTION_NATIVE(AActor, IsActorPlayingSomething, S_IsActorPlayingSomething) DEFINE_ACTION_FUNCTION_NATIVE(AActor, IsActorPlayingSound, S_IsActorPlayingSomething)
{ {
PARAM_SELF_PROLOGUE(AActor); PARAM_SELF_PROLOGUE(AActor);
PARAM_INT(channel); PARAM_INT(channel);

View file

@ -345,7 +345,7 @@ static bool VerifyActorSound(AActor* ent, FSoundID& sound_id, int& channel, ECha
if ((flags & CHANF_MAYBE_LOCAL) && (compatflags & COMPATF_SILENTPICKUP)) if ((flags & CHANF_MAYBE_LOCAL) && (compatflags & COMPATF_SILENTPICKUP))
{ {
if (soundEngine->isListener(ent)) if (!soundEngine->isListener(ent))
{ {
return false; return false;
} }

View file

@ -1155,9 +1155,9 @@ bool SoundEngine::IsSourcePlayingSomething (int sourcetype, const void *actor, i
{ {
if (chan->SourceType == sourcetype && chan->Source == actor) if (chan->SourceType == sourcetype && chan->Source == actor)
{ {
if (channel == 0 || chan->EntChannel == channel) if ((channel == 0 || chan->EntChannel == channel) && (sound_id <= 0 || chan->OrgID == sound_id))
{ {
return sound_id <= 0 || chan->OrgID == sound_id; return true;
} }
} }
} }

View file

@ -169,10 +169,10 @@ struct FSoundChan : public FISoundChannel
FSoundID SoundID; // Sound ID of playing sound. FSoundID SoundID; // Sound ID of playing sound.
FSoundID OrgID; // Sound ID of sound used to start this channel. FSoundID OrgID; // Sound ID of sound used to start this channel.
float Volume; float Volume;
int EntChannel; // Actor's sound channel.
int16_t Pitch; // Pitch variation. int16_t Pitch; // Pitch variation.
uint8_t EntChannel; // Actor's sound channel.
int8_t Priority;
int16_t NearLimit; int16_t NearLimit;
int8_t Priority;
uint8_t SourceType; uint8_t SourceType;
float LimitRange; float LimitRange;
union union

View file

@ -1063,7 +1063,7 @@ class Actor : Thinker native
native void A_StopSound(int slot = CHAN_VOICE); // Bad default but that's what is originally was... native void A_StopSound(int slot = CHAN_VOICE); // Bad default but that's what is originally was...
deprecated("2.3") native void A_PlaySoundEx(sound whattoplay, name slot, bool looping = false, int attenuation = 0); deprecated("2.3") native void A_PlaySoundEx(sound whattoplay, name slot, bool looping = false, int attenuation = 0);
deprecated("2.3") native void A_StopSoundEx(name slot); deprecated("2.3") native void A_StopSoundEx(name slot);
native bool IsActorPlayingSomething(int channel, Sound snd = 0); native clearscope bool IsActorPlayingSound(int channel, Sound snd = 0);
native void A_SeekerMissile(int threshold, int turnmax, int flags = 0, int chance = 50, int distance = 10); native void A_SeekerMissile(int threshold, int turnmax, int flags = 0, int chance = 50, int distance = 10);
native action state A_Jump(int chance, statelabel label, ...); native action state A_Jump(int chance, statelabel label, ...);
native Actor A_SpawnProjectile(class<Actor> missiletype, double spawnheight = 32, double spawnofs_xy = 0, double angle = 0, int flags = 0, double pitch = 0, int ptr = AAPTR_TARGET); native Actor A_SpawnProjectile(class<Actor> missiletype, double spawnheight = 32, double spawnofs_xy = 0, double angle = 0, int flags = 0, double pitch = 0, int ptr = AAPTR_TARGET);