forked from Ports/perfect_dark
port: net: don't play death music, pain and pickup sounds from other players
This commit is contained in:
1 parent
7f92551d5a
commit
2c0a0a1337
6 files changed
+32
-12
No files matched your search
@@ -4042,7 +4042,7 @@ void chrChoke(struct chrdata *chr, s32 choketype)
|
||||
if (soundnum >= 0) {
|
||||
if (chr->prop->type == PROPTYPE_PLAYER) {
|
||||
if (g_Vars.players[playernum]->chokehandle == NULL) {
|
||||
sndStart(var80095200, soundnum, &g_Vars.players[playernum]->chokehandle, -1, -1, -1, -1, -1);
|
||||
playerSndStart(var80095200, soundnum, &g_Vars.players[playernum]->chokehandle, playernum, -1, -1, -1);
|
||||
}
|
||||
} else {
|
||||
psStopSound(chr->prop, PSTYPE_CHRTALK, 0);
|
||||
|
||||
+1
-1
@@ -521,7 +521,7 @@ void _musicStartMpDeath(f32 arg0)
|
||||
void musicStartMpDeath(void)
|
||||
{
|
||||
#ifndef PLATFORM_N64
|
||||
if (g_MusicDisableMpDeath) {
|
||||
if (g_MusicDisableMpDeath || (g_NetMode && g_Vars.currentplayernum != 0)) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -5848,6 +5848,20 @@ void player0f0c3320(Mtxf *matrices, s32 count)
|
||||
}
|
||||
}
|
||||
|
||||
struct sndstate *playerSndStart(s32 arg0, s16 sound, struct sndstate **handle, s32 playernum, f32 pitch, s32 fxbus, s32 fxmix)
|
||||
{
|
||||
s32 vol = -1;
|
||||
s32 pan = -1;
|
||||
#ifndef PLATFORM_N64
|
||||
const struct player *pl = g_Vars.players[playernum];
|
||||
if (g_NetMode && playernum != 0 && pl && pl->prop) {
|
||||
// auto attenuate sounds for remote players
|
||||
psGetTheoreticalVolPan(&pl->prop->pos, pl->prop->rooms, sound, &vol, &pan);
|
||||
}
|
||||
#endif
|
||||
return sndStart(arg0, sound, handle, vol, pan, pitch, fxbus, fxmix);
|
||||
}
|
||||
|
||||
#if MAX_PLAYERS > 4
|
||||
|
||||
s32 playerGetCount(void)
|
||||
|
||||
+8
-8
@@ -16890,7 +16890,7 @@ void ammotypePlayPickupSound(u32 ammotype)
|
||||
case AMMOTYPE_CLOAK:
|
||||
case AMMOTYPE_BOOST:
|
||||
case AMMOTYPE_TOKEN:
|
||||
sndStart(var80095200, SFX_PICKUP_AMMO, NULL, -1, -1, -1, -1, -1);
|
||||
playerSndStart(var80095200, SFX_PICKUP_AMMO, NULL, g_Vars.currentplayernum, -1, -1, -1);
|
||||
break;
|
||||
case AMMOTYPE_REMOTE_MINE:
|
||||
case AMMOTYPE_PROXY_MINE:
|
||||
@@ -16899,10 +16899,10 @@ void ammotypePlayPickupSound(u32 ammotype)
|
||||
case AMMOTYPE_MICROCAMERA:
|
||||
case AMMOTYPE_PLASTIQUE:
|
||||
case AMMOTYPE_ECM_MINE:
|
||||
sndStart(var80095200, SFX_PICKUP_MINE, NULL, -1, -1, -1, -1, -1);
|
||||
playerSndStart(var80095200, SFX_PICKUP_MINE, NULL, g_Vars.currentplayernum, -1, -1, -1);
|
||||
break;
|
||||
case AMMOTYPE_KNIFE:
|
||||
sndStart(var80095200, SFX_PICKUP_KNIFE, NULL, -1, -1, -1, -1, -1);
|
||||
playerSndStart(var80095200, SFX_PICKUP_KNIFE, NULL, g_Vars.currentplayernum, -1, -1, -1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -16967,7 +16967,7 @@ void weaponPlayPickupSound(s32 weaponnum)
|
||||
sound = SFX_PICKUP_GUN;
|
||||
}
|
||||
|
||||
sndStart(var80095200, sound, NULL, -1, -1, -1, -1, -1);
|
||||
playerSndStart(var80095200, sound, NULL, g_Vars.currentplayernum, -1, -1, -1);
|
||||
}
|
||||
|
||||
void ammotypeGetPickupMessage(char *dst, s32 ammotype, s32 qty)
|
||||
@@ -17280,7 +17280,7 @@ s32 propPickupByPlayer(struct prop *prop, bool showhudmsg)
|
||||
switch (obj->type) {
|
||||
case OBJTYPE_KEY:
|
||||
if (g_Vars.in_cutscene == false) {
|
||||
sndStart(var80095200, SFX_PICKUP_KEYCARD, NULL, -1, -1, -1, -1, -1);
|
||||
playerSndStart(var80095200, SFX_PICKUP_KEYCARD, NULL, g_Vars.currentplayernum, -1, -1, -1);
|
||||
}
|
||||
|
||||
if (showhudmsg) {
|
||||
@@ -17320,7 +17320,7 @@ s32 propPickupByPlayer(struct prop *prop, bool showhudmsg)
|
||||
}
|
||||
|
||||
if (g_Vars.in_cutscene == false) {
|
||||
sndStart(var80095200, SFX_PICKUP_AMMO, NULL, -1, -1, -1, -1, -1);
|
||||
playerSndStart(var80095200, SFX_PICKUP_AMMO, NULL, g_Vars.currentplayernum, -1, -1, -1);
|
||||
}
|
||||
|
||||
result = TICKOP_FREE;
|
||||
@@ -17473,7 +17473,7 @@ s32 propPickupByPlayer(struct prop *prop, bool showhudmsg)
|
||||
playerSetShieldFrac(((struct shieldobj *) prop->obj)->amount);
|
||||
|
||||
if (!g_Vars.in_cutscene) {
|
||||
sndStart(var80095200, SFX_PICKUP_SHIELD, NULL, -1, -1, -1, -1, -1);
|
||||
playerSndStart(var80095200, SFX_PICKUP_SHIELD, NULL, g_Vars.currentplayernum, -1, -1, -1);
|
||||
}
|
||||
|
||||
if (showhudmsg) {
|
||||
@@ -17510,7 +17510,7 @@ s32 propPickupByPlayer(struct prop *prop, bool showhudmsg)
|
||||
case OBJTYPE_TINTEDGLASS:
|
||||
default:
|
||||
if (g_Vars.in_cutscene == false) {
|
||||
sndStart(var80095200, SFX_PICKUP_KEYCARD, NULL, -1, -1, -1, -1, -1);
|
||||
playerSndStart(var80095200, SFX_PICKUP_KEYCARD, NULL, g_Vars.currentplayernum, -1, -1, -1);
|
||||
}
|
||||
|
||||
if (showhudmsg) {
|
||||
|
||||
+7
-2
@@ -1284,11 +1284,16 @@ s32 psCalculatePan2(struct coord *pos, s32 arg1, f32 arg2, struct pschannel *cha
|
||||
f32 f2;
|
||||
|
||||
if (LOCALPLAYERCOUNT() < 2) {
|
||||
struct coord *campos = &g_Vars.currentplayer->cam_pos;
|
||||
#ifdef PLATFORM_N64
|
||||
struct player *player = g_Vars.currentplayer;
|
||||
#else
|
||||
struct player *player = g_Vars.players[0] ? g_Vars.players[0] : g_Vars.currentplayer;
|
||||
#endif
|
||||
struct coord *campos = &player->cam_pos;
|
||||
f32 sp3c;
|
||||
f32 sp38;
|
||||
|
||||
f2 = -(atan2f(pos->x - campos->x, pos->z - campos->z) * 180.0f / M_PI + g_Vars.currentplayer->vv_theta);
|
||||
f2 = -(atan2f(pos->x - campos->x, pos->z - campos->z) * 180.0f / M_PI + player->vv_theta);
|
||||
|
||||
if (arg2 >= 0.0f) {
|
||||
sp3c = sinf(0.017453292f * f2);
|
||||
|
||||
@@ -107,5 +107,6 @@ void playerSetCamPropertiesWithoutRoom(struct coord *pos, struct coord *up, stru
|
||||
void playerSetCamProperties(struct coord *pos, struct coord *up, struct coord *look, s32 room);
|
||||
void playerClearMemCamRoom(void);
|
||||
s32 playerGetCount(void);
|
||||
struct sndstate *playerSndStart(s32 arg0, s16 sound, struct sndstate **handle, s32 playernum, f32 pitch, s32 fxbus, s32 fxmix);
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user