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.
@@ -25836,23 +25836,31 @@ function PlayerNoise(who, where, type, context) {
25836
25836
  noise.origin = { ...where };
25837
25837
  context.linkentity(noise);
25838
25838
  const awareness = context.targetAwareness;
25839
- if (!awareness) return;
25840
- if (type === PNOISE_WEAPON) {
25841
- if (awareness.soundEntity === noise) {
25842
- awareness.soundEntityFrame = awareness.frameNumber;
25843
- } else {
25844
- awareness.sound2Entity = awareness.soundEntity;
25845
- awareness.sound2EntityFrame = awareness.soundEntityFrame;
25846
- awareness.soundEntity = noise;
25847
- awareness.soundEntityFrame = awareness.frameNumber;
25848
- }
25849
- } else if (type === PNOISE_SELF) {
25850
- if (awareness.sightEntity === noise) {
25851
- awareness.sightEntityFrame = awareness.frameNumber;
25852
- } else {
25853
- awareness.sightClient = noise;
25839
+ if (awareness) {
25840
+ if (type === PNOISE_WEAPON) {
25841
+ if (awareness.soundEntity === noise) {
25842
+ awareness.soundEntityFrame = awareness.frameNumber;
25843
+ } else {
25844
+ awareness.sound2Entity = awareness.soundEntity;
25845
+ awareness.sound2EntityFrame = awareness.soundEntityFrame;
25846
+ awareness.soundEntity = noise;
25847
+ awareness.soundEntityFrame = awareness.frameNumber;
25848
+ }
25849
+ } else if (type === PNOISE_SELF) {
25850
+ if (awareness.sightEntity === noise) {
25851
+ awareness.sightEntityFrame = awareness.frameNumber;
25852
+ } else {
25853
+ awareness.sightClient = noise;
25854
+ }
25854
25855
  }
25855
25856
  }
25857
+ if (type === PNOISE_SELF || type === PNOISE_WEAPON) {
25858
+ who.client.sound_entity = noise;
25859
+ who.client.sound_entity_time = context.timeSeconds;
25860
+ } else {
25861
+ who.client.sound2_entity = noise;
25862
+ who.client.sound2_entity_time = context.timeSeconds;
25863
+ }
25856
25864
  }
25857
25865
 
25858
25866
  // src/entities/player.ts