Merge remote-tracking branch 'upstream/miami' into miami

This commit is contained in:
Nikolay Korolev 2021-01-01 23:06:44 +03:00
commit a7f053776a
4 changed files with 11 additions and 11 deletions

View File

@ -4354,7 +4354,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
m_sQueueSample.m_nFrequency = 20000; m_sQueueSample.m_nFrequency = 20000;
AddFightSound: AddFightSound:
{ {
uint32 soundParams = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i]; // wtf? stroring int as float uint32 soundParams = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i]; // wtf? storing int as float
uint8 damagerType = soundParams & 0xFF; uint8 damagerType = soundParams & 0xFF;
uint32 weaponType = soundParams >> 8; uint32 weaponType = soundParams >> 8;
@ -4402,7 +4402,7 @@ cAudioManager::ProcessPedOneShots(cPedParams &params)
case SOUND_WEAPON_BAT_ATTACK: case SOUND_WEAPON_BAT_ATTACK:
case SOUND_WEAPON_KNIFE_ATTACK: case SOUND_WEAPON_KNIFE_ATTACK:
{ {
uint32 soundParams = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i]; // wtf? stroring int as float uint32 soundParams = m_asAudioEntities[m_sQueueSample.m_nEntityIndex].m_afVolume[i]; // wtf? storing int as float
uint8 damagerType = soundParams & 0xFF; uint8 damagerType = soundParams & 0xFF;
uint32 weaponType = soundParams >> 8; uint32 weaponType = soundParams >> 8;
if (damagerType == ENTITY_TYPE_PED) { if (damagerType == ENTITY_TYPE_PED) {

View File

@ -2021,9 +2021,9 @@ CPed::PlayHitSound(CPed *hitTo)
if (weaponInfo->m_AnimToPlay == ASSOCGRP_KNIFE) { if (weaponInfo->m_AnimToPlay == ASSOCGRP_KNIFE) {
if (m_curFightMove >= FIGHTMOVE_MELEE1) { if (m_curFightMove >= FIGHTMOVE_MELEE1) {
if (m_curFightMove == FIGHTMOVE_MELEE3) { if (m_curFightMove == FIGHTMOVE_MELEE3) {
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_BAT_ATTACK, (weapon << 8) | 3); DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_BAT_ATTACK, (weapon << 8) | ENTITY_TYPE_PED);
} else { } else {
DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_KNIFE_ATTACK, (weapon << 8) | 3); DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_KNIFE_ATTACK, (weapon << 8) | ENTITY_TYPE_PED);
} }
return; return;
} }
@ -2048,7 +2048,7 @@ CPed::PlayHitSound(CPed *hitTo)
} }
if (soundId != NO_SND) if (soundId != NO_SND)
DMAudio.PlayOneShot(m_audioEntityId, soundId, (weapon << 8) | 3); DMAudio.PlayOneShot(m_audioEntityId, soundId, (weapon << 8) | ENTITY_TYPE_PED);
} }
// --MIAMI: Done // --MIAMI: Done
@ -3567,7 +3567,7 @@ CPed::CollideWithPed(CPed *collideWith)
animAssoc->flags |= ASSOC_FADEOUTWHENDONE; animAssoc->flags |= ASSOC_FADEOUTWHENDONE;
collideWith->m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 1000; collideWith->m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 1000;
if (m_nPedState == PED_ATTACK) if (m_nPedState == PED_ATTACK)
DMAudio.PlayOneShot(m_audioEntityId, SOUND_FIGHT_46, 0.0f); DMAudio.PlayOneShot(m_audioEntityId, SOUND_49, 0.0f);
} }
} else { } else {
// We're at his right side // We're at his right side

View File

@ -226,15 +226,15 @@ void CWeather::Update(void)
// Rain // Rain
float fNewRain; float fNewRain;
if (NewWeatherType == WEATHER_RAINY || NewWeatherType == WEATHER_HURRICANE) { if (NewWeatherType == WEATHER_RAINY || NewWeatherType == WEATHER_HURRICANE) {
// if raining for >1 hour, values: 0, 0.33, 0.66, 0.99, switching every ~16.5s // if raining for >1 hour, values: 0, 0.33, switching every ~16.5s
fNewRain = ((uint16)CTimer::GetTimeInMilliseconds() >> 14) * 0.33f; fNewRain = (((uint16)CTimer::GetTimeInMilliseconds() >> 14) & 1) * 0.33f;
if (OldWeatherType != WEATHER_RAINY && OldWeatherType != WEATHER_HURRICANE) { if (OldWeatherType != WEATHER_RAINY && OldWeatherType != WEATHER_HURRICANE) {
if (InterpolationValue < 0.4f) if (InterpolationValue < 0.4f)
// if rain has just started (<24 minutes), always 0.5 // if rain has just started (<24 minutes), always 0.5
fNewRain = 0.5f; fNewRain = 0.5f;
else else
// if rain is ongoing for >24 minutes, values: 0.25, 0.5, 0.75, 1.0, switching every ~16.5s // if rain is ongoing for >24 minutes, values: 0.25, 0.5, switching every ~16.5s
fNewRain = 0.25f + ((uint16)CTimer::GetTimeInMilliseconds() >> 14) * 0.25f; fNewRain = 0.25f + (((uint16)CTimer::GetTimeInMilliseconds() >> 14) & 1) * 0.25f;
} }
fNewRain = Max(fNewRain, 0.5f); fNewRain = Max(fNewRain, 0.5f);
} }

View File

@ -2694,7 +2694,7 @@ CBike::KnockOffRider(eWeaponType weapon, uint8 direction, CPed *ped, bool bGetBa
switch(direction){ switch(direction){
case 0: anim = ANIM_KO_SKID_BACK; break; case 0: anim = ANIM_KO_SKID_BACK; break;
case 1: anim = ANIM_KD_RIGHT; break; case 1: anim = ANIM_KD_RIGHT; break;
case 2: anim = ANIM_KO_SKID_FRONT; break; case 2: anim = ANIM_BIKE_FALL_R; break;
case 3: anim = ANIM_KD_LEFT; break; case 3: anim = ANIM_KD_LEFT; break;
} }
if(m_nWheelsOnGround == 0) if(m_nWheelsOnGround == 0)