Skip to content

Commit

Permalink
Don't show switch gun chatter for NPCs
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Dec 9, 2023
1 parent 0a8b0c4 commit 8164233
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/cdogs/actors.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,11 @@ void ActorReplaceGun(const NActorReplaceGun rg)
a->gunIndex = rg.GunIdx;
}
SoundPlayAt(&gSoundDevice, wc->SwitchSound, a->Pos);
ActorSetChatter(a, wc->name, CHATTER_SWITCH_GUN);
// Show gun switch text as chatter, but only for PCs
if (a->PlayerUID >= 0)
{
ActorSetChatter(a, wc->name, CHATTER_SWITCH_GUN);
}
}

int ActorFindGun(const TActor *a, const WeaponClass *wc)
Expand Down Expand Up @@ -1961,7 +1965,11 @@ void ActorSwitchGun(const NActorSwitchGun sg)
}
const WeaponClass *gun = ACTOR_GET_WEAPON(a)->Gun;
SoundPlayAt(&gSoundDevice, gun->SwitchSound, a->thing.Pos);
ActorSetChatter(a, gun->name, CHATTER_SWITCH_GUN);
// Show gun switch text as chatter, but only for PCs
if (a->PlayerUID >= 0)
{
ActorSetChatter(a, gun->name, CHATTER_SWITCH_GUN);
}
}

void ActorPickupGun(const TActor *a, const WeaponClass *wc)
Expand Down

0 comments on commit 8164233

Please sign in to comment.