mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
ProcessNoise: fixed incorrect noise terrain check.
Reverted r9259. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9274 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -51,7 +51,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
BOOLEAN gfSetPerceivedDoorState = FALSE;
|
BOOLEAN gfSetPerceivedDoorState = FALSE;
|
||||||
extern BOOLEAN gfPlayerMercHeardNoise;
|
|
||||||
|
|
||||||
BOOLEAN HandleDoorsOpenClose( SOLDIERTYPE *pSoldier, INT32 sGridNo, STRUCTURE * pStructure, BOOLEAN fNoAnimations );
|
BOOLEAN HandleDoorsOpenClose( SOLDIERTYPE *pSoldier, INT32 sGridNo, STRUCTURE * pStructure, BOOLEAN fNoAnimations );
|
||||||
|
|
||||||
@@ -1161,9 +1160,6 @@ BOOLEAN HandleDoorsOpenClose( SOLDIERTYPE *pSoldier, INT32 sGridNo, STRUCTURE *
|
|||||||
cnt++;
|
cnt++;
|
||||||
};
|
};
|
||||||
|
|
||||||
// sevenfm: reset code to detect heard noise
|
|
||||||
gfPlayerMercHeardNoise = FALSE;
|
|
||||||
|
|
||||||
if (pSoldier && pSoldier->ubDoorOpeningNoise > 0)
|
if (pSoldier && pSoldier->ubDoorOpeningNoise > 0)
|
||||||
{
|
{
|
||||||
//shadooow: noise handling moved here so we can work with modified value of pSoldier->ubDoorOpeningNoise
|
//shadooow: noise handling moved here so we can work with modified value of pSoldier->ubDoorOpeningNoise
|
||||||
@@ -1284,11 +1280,8 @@ BOOLEAN HandleDoorsOpenClose( SOLDIERTYPE *pSoldier, INT32 sGridNo, STRUCTURE *
|
|||||||
uiSoundID = METAL_DOOR_OPEN;
|
uiSoundID = METAL_DOOR_OPEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSoldier && pSoldier->bVisible == TRUE || gfPlayerMercHeardNoise)
|
// OK, We must know what sound to play, for now use same sound for all doors...
|
||||||
{
|
PlayJA2Sample(uiSoundID, RATE_11025, SoundVolume(MIDVOLUME, sGridNo), 1, SoundDir(sGridNo));
|
||||||
// OK, We must know what sound to play, for now use same sound for all doors...
|
|
||||||
PlayJA2Sample(uiSoundID, RATE_11025, SoundVolume(MIDVOLUME, sGridNo), 1, SoundDir(sGridNo));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((gWorldSectorX == gModSettings.ubInitialPOWSectorX && gWorldSectorY == gModSettings.ubInitialPOWSectorY) ||
|
if (((gWorldSectorX == gModSettings.ubInitialPOWSectorX && gWorldSectorY == gModSettings.ubInitialPOWSectorY) ||
|
||||||
@@ -1414,11 +1407,8 @@ BOOLEAN HandleDoorsOpenClose( SOLDIERTYPE *pSoldier, INT32 sGridNo, STRUCTURE *
|
|||||||
uiSoundID = METAL_DOOR_CLOSE;
|
uiSoundID = METAL_DOOR_CLOSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pSoldier && pSoldier->bVisible == TRUE || gfPlayerMercHeardNoise)
|
// OK, We must know what sound to play, for now use same sound for all doors...
|
||||||
{
|
PlayJA2Sample(uiSoundID, RATE_11025, SoundVolume(MIDVOLUME, sGridNo), 1, SoundDir(sGridNo));
|
||||||
// OK, We must know what sound to play, for now use same sound for all doors...
|
|
||||||
PlayJA2Sample(uiSoundID, RATE_11025, SoundVolume(MIDVOLUME, sGridNo), 1, SoundDir(sGridNo));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-10
@@ -5784,8 +5784,6 @@ void TheirNoise(UINT8 ubNoiseMaker, INT32 sGridNo, INT8 bLevel, UINT8 ubTerrType
|
|||||||
// else if noiseMaker's NOBODY, no opplist changes or interrupts are possible
|
// else if noiseMaker's NOBODY, no opplist changes or interrupts are possible
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN gfPlayerMercHeardNoise = FALSE;
|
|
||||||
|
|
||||||
void ProcessNoise(UINT8 ubNoiseMaker, INT32 sGridNo, INT8 bLevel, UINT8 ubTerrType, UINT8 ubBaseVolume, UINT8 ubNoiseType, STR16 zNoiseMessage )
|
void ProcessNoise(UINT8 ubNoiseMaker, INT32 sGridNo, INT8 bLevel, UINT8 ubTerrType, UINT8 ubBaseVolume, UINT8 ubNoiseType, STR16 zNoiseMessage )
|
||||||
{
|
{
|
||||||
SOLDIERTYPE *pSoldier;
|
SOLDIERTYPE *pSoldier;
|
||||||
@@ -5853,14 +5851,13 @@ void ProcessNoise(UINT8 ubNoiseMaker, INT32 sGridNo, INT8 bLevel, UINT8 ubTerrTy
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// if we have now somehow obtained a valid terrain type //shadooow: and it is not a noise from doors
|
// if we have now somehow obtained a valid terrain type //shadooow: and it is not a noise from doors
|
||||||
if (ubNoiseType != NOISE_CREAKING && ((ubSourceTerrType >= FLAT_GROUND) || (ubSourceTerrType <= DEEP_WATER)))
|
if (ubNoiseType != NOISE_CREAKING && ubSourceTerrType >= FLAT_GROUND && ubSourceTerrType <= DEEP_WATER)
|
||||||
{
|
{
|
||||||
//NumMessage("Source Terrain Type = ",ubSourceTerrType);
|
//NumMessage("Source Terrain Type = ",ubSourceTerrType);
|
||||||
bCheckTerrain = TRUE;
|
bCheckTerrain = TRUE;
|
||||||
}
|
}
|
||||||
// else give up trying to get terrain type, just assume sound isn't muffled
|
// else give up trying to get terrain type, just assume sound isn't muffled
|
||||||
|
|
||||||
|
|
||||||
// DETERMINE THE *PERCEIVED* SOURCE OF THE NOISE
|
// DETERMINE THE *PERCEIVED* SOURCE OF THE NOISE
|
||||||
switch (ubNoiseType)
|
switch (ubNoiseType)
|
||||||
{
|
{
|
||||||
@@ -6022,12 +6019,6 @@ void ProcessNoise(UINT8 ubNoiseMaker, INT32 sGridNo, INT8 bLevel, UINT8 ubTerrTy
|
|||||||
// Can the listener hear noise of that volume given his circumstances?
|
// Can the listener hear noise of that volume given his circumstances?
|
||||||
ubEffVolume = CalcEffVolume(pSoldier, sGridNo, bLevel, ubNoiseType, ubBaseVolume, bCheckTerrain, pSoldier->bOverTerrainType, ubSourceTerrType);
|
ubEffVolume = CalcEffVolume(pSoldier, sGridNo, bLevel, ubNoiseType, ubBaseVolume, bCheckTerrain, pSoldier->bOverTerrainType, ubSourceTerrType);
|
||||||
|
|
||||||
// sevenfm: indicate that player team heard noise
|
|
||||||
if (bTeam == gbPlayerNum && ubEffVolume > 0)
|
|
||||||
{
|
|
||||||
gfPlayerMercHeardNoise = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if a the noise maker is a person, not just NOBODY
|
// if a the noise maker is a person, not just NOBODY
|
||||||
if (ubNoiseMaker < TOTAL_SOLDIERS)
|
if (ubNoiseMaker < TOTAL_SOLDIERS)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user