quake2ts 0.0.477 → 0.0.479

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25644,23 +25644,31 @@ function PlayerNoise(who, where, type, context) {
25644
25644
  noise.origin = { ...where };
25645
25645
  context.linkentity(noise);
25646
25646
  const awareness = context.targetAwareness;
25647
- if (!awareness) return;
25648
- if (type === PNOISE_WEAPON) {
25649
- if (awareness.soundEntity === noise) {
25650
- awareness.soundEntityFrame = awareness.frameNumber;
25651
- } else {
25652
- awareness.sound2Entity = awareness.soundEntity;
25653
- awareness.sound2EntityFrame = awareness.soundEntityFrame;
25654
- awareness.soundEntity = noise;
25655
- awareness.soundEntityFrame = awareness.frameNumber;
25656
- }
25657
- } else if (type === PNOISE_SELF) {
25658
- if (awareness.sightEntity === noise) {
25659
- awareness.sightEntityFrame = awareness.frameNumber;
25660
- } else {
25661
- awareness.sightClient = noise;
25647
+ if (awareness) {
25648
+ if (type === PNOISE_WEAPON) {
25649
+ if (awareness.soundEntity === noise) {
25650
+ awareness.soundEntityFrame = awareness.frameNumber;
25651
+ } else {
25652
+ awareness.sound2Entity = awareness.soundEntity;
25653
+ awareness.sound2EntityFrame = awareness.soundEntityFrame;
25654
+ awareness.soundEntity = noise;
25655
+ awareness.soundEntityFrame = awareness.frameNumber;
25656
+ }
25657
+ } else if (type === PNOISE_SELF) {
25658
+ if (awareness.sightEntity === noise) {
25659
+ awareness.sightEntityFrame = awareness.frameNumber;
25660
+ } else {
25661
+ awareness.sightClient = noise;
25662
+ }
25662
25663
  }
25663
25664
  }
25665
+ if (type === PNOISE_SELF || type === PNOISE_WEAPON) {
25666
+ who.client.sound_entity = noise;
25667
+ who.client.sound_entity_time = context.timeSeconds;
25668
+ } else {
25669
+ who.client.sound2_entity = noise;
25670
+ who.client.sound2_entity_time = context.timeSeconds;
25671
+ }
25664
25672
  }
25665
25673
 
25666
25674
  // src/entities/player.ts