1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-18 06:17:45 +00:00

Merge pull request #614 from erorcun/miami

Peds, eSound and PedState enum, fixes
This commit is contained in:
erorcun 2020-06-03 17:06:07 +03:00 committed by GitHub
commit 1e2b087601
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 1089 additions and 638 deletions

View file

@ -158,7 +158,7 @@ AnimAssocDesc aStdAnimDescs[] = {
{ ANIM_CAR_CRAWLOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_CAR_CRAWLOUT_RHS, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_CRAWLOUT_RHS2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL }, { ANIM_CAR_CRAWLOUT_RHS2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL },
{ ANIM_CAR_ROLLOUT_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION }, { ANIM_CAR_ROLLOUT_LHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
{ ANIM_CAR_ROLLOUT_LHS2, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION }, { ANIM_CAR_ROLLOUT_RHS, ASSOC_DELETEFADEDOUT | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION | ASSOC_HAS_X_TRANSLATION },
{ ANIM_GETUP1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_GETUP1, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_GETUP2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_GETUP2, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },
{ ANIM_GETUP3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION }, { ANIM_GETUP3, ASSOC_FADEOUTWHENDONE | ASSOC_PARTIAL | ASSOC_HAS_TRANSLATION },

View file

@ -146,7 +146,7 @@ enum AnimationId
ANIM_CAR_CRAWLOUT_RHS, ANIM_CAR_CRAWLOUT_RHS,
ANIM_CAR_CRAWLOUT_RHS2, ANIM_CAR_CRAWLOUT_RHS2,
ANIM_CAR_ROLLOUT_LHS, ANIM_CAR_ROLLOUT_LHS,
ANIM_CAR_ROLLOUT_LHS2, // was this meant to be RHS? ANIM_CAR_ROLLOUT_RHS, // was this meant to be RHS?
ANIM_GETUP1, ANIM_GETUP1,
ANIM_GETUP2, ANIM_GETUP2,

View file

@ -1639,27 +1639,31 @@ cAudioManager::UsesSirenSwitching(int32 model) const
} }
} }
void bool
cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams *params) cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams *params)
{ {
const float SOUND_INTENSITY = 110.0f; const float SOUND_INTENSITY = 110.0f;
if (params->m_fDistance < SQR(SOUND_INTENSITY)) { if (params->m_fDistance < SQR(SOUND_INTENSITY)) {
CVehicle *veh = params->m_pVehicle; CVehicle *veh = params->m_pVehicle;
if (veh->m_bSirenOrAlarm == false && veh->m_nAlarmState <= 0) if (veh->m_bSirenOrAlarm == false && !veh->IsAlarmOn())
return; return true;
if (veh->IsAlarmOn()) {
if (CTimer::GetTimeInMilliseconds() > veh->m_bRainAudioCounter)
veh->m_bRainAudioCounter = CTimer::GetTimeInMilliseconds() + 750;
if (veh->m_bRainAudioCounter < CTimer::GetTimeInMilliseconds() + 375)
return true;
}
#ifdef FIX_BUGS
if (params->m_pVehicle->GetStatus() == STATUS_WRECKED)
return;
#endif
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
m_sQueueSample.m_nVolume = ComputeVolume(80, SOUND_INTENSITY, m_sQueueSample.m_fDistance); m_sQueueSample.m_nVolume = ComputeVolume(veh->bIsDrowning ? 20 : 80, SOUND_INTENSITY, m_sQueueSample.m_fDistance);
if (m_sQueueSample.m_nVolume != 0) { if (m_sQueueSample.m_nVolume != 0) {
m_sQueueSample.m_nCounter = 5; m_sQueueSample.m_nCounter = 5;
if (UsesSiren(params->m_nIndex)) { if (UsesSiren(params->m_nIndex)) {
if (params->m_pVehicle->GetStatus() == STATUS_ABANDONED) if (params->m_pVehicle->GetStatus() == STATUS_ABANDONED)
return; return true;
if (veh->m_nCarHornTimer && params->m_nIndex != FIRETRUK) { if (veh->m_nCarHornTimer && params->m_nIndex != FIRETRUK) {
m_sQueueSample.m_nSampleIndex = SFX_SIREN_FAST; m_sQueueSample.m_nSampleIndex = SFX_SIREN_FAST;
if (params->m_nIndex == FBICAR) if (params->m_nIndex == FBICAR)
@ -1689,8 +1693,11 @@ cAudioManager::ProcessVehicleSirenOrAlarm(cVehicleParams *params)
m_sQueueSample.m_bReverbFlag = true; m_sQueueSample.m_bReverbFlag = true;
m_sQueueSample.m_bRequireReflection = false; m_sQueueSample.m_bRequireReflection = false;
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} return true;
} } else
return true;
} else
return false;
} }
bool bool
@ -2144,8 +2151,8 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
maxDist = SQR(SOUND_INTENSITY); maxDist = SQR(SOUND_INTENSITY);
break; break;
}*/ }*/
case SOUND_18: case SOUND_TRAIN_DOOR_CLOSE:
case SOUND_19: { case SOUND_TRAIN_DOOR_OPEN: {
const float SOUND_INTENSITY = 35.0f; const float SOUND_INTENSITY = 35.0f;
m_sQueueSample.m_nSampleIndex = SFX_AIR_BRAKES; m_sQueueSample.m_nSampleIndex = SFX_AIR_BRAKES;
m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN;
@ -2235,7 +2242,7 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
break; break;
} }
case SOUND_BOMB_TIMED_ACTIVATED: case SOUND_BOMB_TIMED_ACTIVATED:
case SOUND_55: case SOUND_91:
case SOUND_BOMB_ONIGNITION_ACTIVATED: case SOUND_BOMB_ONIGNITION_ACTIVATED:
case SOUND_BOMB_TICK: { case SOUND_BOMB_TICK: {
const float SOUND_INTENSITY = 50.0f; const float SOUND_INTENSITY = 50.0f;
@ -2259,14 +2266,14 @@ cAudioManager::ProcessVehicleOneShots(cVehicleParams *params)
pedParams.m_fDistance = params->m_fDistance; pedParams.m_fDistance = params->m_fDistance;
SetupPedComments(&pedParams, SOUND_PED_HELI_PLAYER_FOUND); SetupPedComments(&pedParams, SOUND_PED_HELI_PLAYER_FOUND);
continue; continue;
case SOUND_PED_BODYCAST_HIT: /* case SOUND_PED_BODYCAST_HIT:
pedParams.m_pPed = nil; pedParams.m_pPed = nil;
pedParams.m_bDistanceCalculated = false; pedParams.m_bDistanceCalculated = false;
pedParams.m_fDistance = 0.0f; pedParams.m_fDistance = 0.0f;
pedParams.m_bDistanceCalculated = params->m_bDistanceCalculated; pedParams.m_bDistanceCalculated = params->m_bDistanceCalculated;
pedParams.m_fDistance = params->m_fDistance; pedParams.m_fDistance = params->m_fDistance;
SetupPedComments(&pedParams, SOUND_PED_BODYCAST_HIT); SetupPedComments(&pedParams, SOUND_PED_BODYCAST_HIT);
continue; continue; */
case SOUND_WATER_FALL: { case SOUND_WATER_FALL: {
const float SOUND_INTENSITY = 40.0f; const float SOUND_INTENSITY = 40.0f;
m_sQueueSample.m_nSampleIndex = SFX_SPLASH_1; m_sQueueSample.m_nSampleIndex = SFX_SPLASH_1;
@ -2499,7 +2506,7 @@ cAudioManager::ProcessBoatEngine(cVehicleParams *params)
m_sQueueSample.m_nSampleIndex = SFX_FISHING_BOAT_IDLE; m_sQueueSample.m_nSampleIndex = SFX_FISHING_BOAT_IDLE;
if (LastAccel > 20) { if (LastAccel > 20) {
oneShotVol = LastVol; oneShotVol = LastVol;
PlayOneShot(m_sQueueSample.m_nEntityIndex, SOUND_17, oneShotVol); PlayOneShot(m_sQueueSample.m_nEntityIndex, SOUND_BOAT_SLOWDOWN, oneShotVol);
} }
} else { } else {
emittingVol = 105 * padAccelerate / 255 + 15; emittingVol = 105 * padAccelerate / 255 + 15;
@ -3604,8 +3611,6 @@ cAudioManager::ProcessPedOneShots(cPedParams *params)
m_sQueueSample.m_bRequireReflection = true; m_sQueueSample.m_bRequireReflection = true;
break; break;
case SOUND_WEAPON_AK47_BULLET_ECHO: case SOUND_WEAPON_AK47_BULLET_ECHO:
case SOUND_WEAPON_UZI_BULLET_ECHO:
case SOUND_WEAPON_M16_BULLET_ECHO:
m_sQueueSample.m_nSampleIndex = SFX_UZI_END_LEFT; m_sQueueSample.m_nSampleIndex = SFX_UZI_END_LEFT;
m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN; m_sQueueSample.m_nBankIndex = SAMPLEBANK_MAIN;
m_sQueueSample.m_nCounter = iSound++; m_sQueueSample.m_nCounter = iSound++;
@ -3781,11 +3786,11 @@ cAudioManager::SetupPedComments(cPedParams *params, uint32 sound)
CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance); CalculateDistance(params->m_bDistanceCalculated, params->m_fDistance);
if (sound != SOUND_PAGER) { if (sound != SOUND_PAGER) {
switch (sound) { switch (sound) {
case SOUND_AMMUNATION_WELCOME_1: /*case SOUND_AMMUNATION_WELCOME_1:
case SOUND_AMMUNATION_WELCOME_2: case SOUND_AMMUNATION_WELCOME_2:
case SOUND_AMMUNATION_WELCOME_3: case SOUND_AMMUNATION_WELCOME_3:
emittingVol = MAX_VOLUME; emittingVol = MAX_VOLUME;
break; break; */
default: default:
if (CWorld::GetIsLineOfSightClear(TheCamera.GetPosition(), m_sQueueSample.m_vecPos, true, false, false, false, false, false)) if (CWorld::GetIsLineOfSightClear(TheCamera.GetPosition(), m_sQueueSample.m_vecPos, true, false, false, false, false, false))
emittingVol = MAX_VOLUME; emittingVol = MAX_VOLUME;
@ -4664,10 +4669,6 @@ cAudioManager::ProcessFrontEnd()
m_sQueueSample.m_nSampleIndex = SFX_FE_HIGHLIGHT_LEFT; m_sQueueSample.m_nSampleIndex = SFX_FE_HIGHLIGHT_LEFT;
stereo = true; stereo = true;
break; break;
case SOUND_FRONTEND_MENU_DENIED:
m_sQueueSample.m_nSampleIndex = SFX_FE_HIGHLIGHT_LEFT;
stereo = true;
break;
case SOUND_FRONTEND_MENU_SUCCESS: case SOUND_FRONTEND_MENU_SUCCESS:
m_sQueueSample.m_nSampleIndex = SFX_FE_SELECT_LEFT; m_sQueueSample.m_nSampleIndex = SFX_FE_SELECT_LEFT;
stereo = true; stereo = true;
@ -4687,7 +4688,7 @@ cAudioManager::ProcessFrontEnd()
case SOUND_FRONTEND_RADIO_CHANGE: case SOUND_FRONTEND_RADIO_CHANGE:
m_sQueueSample.m_nSampleIndex = SFX_RADIO_CLICK; m_sQueueSample.m_nSampleIndex = SFX_RADIO_CLICK;
break; break;
//case SOUND_A0: //case SOUND_HUD_SOUND:
// m_sQueueSample.m_nSampleIndex = SFX_INFO; // m_sQueueSample.m_nSampleIndex = SFX_INFO;
// break; // break;
default: default:

View file

@ -339,7 +339,7 @@ public:
void ProcessVehicleOneShots(cVehicleParams *params); void ProcessVehicleOneShots(cVehicleParams *params);
bool ProcessVehicleReverseWarning(cVehicleParams *params); bool ProcessVehicleReverseWarning(cVehicleParams *params);
bool ProcessVehicleRoadNoise(cVehicleParams *params); bool ProcessVehicleRoadNoise(cVehicleParams *params);
void ProcessVehicleSirenOrAlarm(cVehicleParams *params); bool ProcessVehicleSirenOrAlarm(cVehicleParams *params);
void ProcessVehicleSkidding(cVehicleParams *params); void ProcessVehicleSkidding(cVehicleParams *params);
void ProcessWaterCannon(int32); void ProcessWaterCannon(int32);
void ProcessWeather(int32 id); void ProcessWeather(int32 id);

View file

@ -16,8 +16,10 @@ enum eSound : uint16
SOUND_CAR_DOOR_OPEN_BACK_RIGHT, SOUND_CAR_DOOR_OPEN_BACK_RIGHT,
SOUND_CAR_WINDSHIELD_CRACK, SOUND_CAR_WINDSHIELD_CRACK,
SOUND_CAR_JUMP, SOUND_CAR_JUMP,
SOUND_E, SOUND_CAR_JUMP_2,
SOUND_F, SOUND_CAR_TYRE_POP,
SOUND_16,
SOUND_17,
SOUND_CAR_ENGINE_START, SOUND_CAR_ENGINE_START,
SOUND_CAR_LIGHT_BREAK, SOUND_CAR_LIGHT_BREAK,
SOUND_CAR_HYDRAULIC_1, SOUND_CAR_HYDRAULIC_1,
@ -25,12 +27,14 @@ enum eSound : uint16
SOUND_CAR_HYDRAULIC_3, SOUND_CAR_HYDRAULIC_3,
SOUND_CAR_JERK, SOUND_CAR_JERK,
SOUND_CAR_SPLASH, SOUND_CAR_SPLASH,
SOUND_17, SOUND_BOAT_SLOWDOWN,
SOUND_18, SOUND_TRAIN_DOOR_CLOSE,
SOUND_19, SOUND_TRAIN_DOOR_OPEN,
SOUND_CAR_TANK_TURRET_ROTATE, SOUND_CAR_TANK_TURRET_ROTATE,
SOUND_CAR_BOMB_TICK, SOUND_CAR_BOMB_TICK,
SOUND_PLANE_ON_GROUND, SOUND_PLANE_ON_GROUND,
SOUND_31,
SOUND_32,
SOUND_STEP_START, SOUND_STEP_START,
SOUND_STEP_END, SOUND_STEP_END,
SOUND_FALL_LAND, SOUND_FALL_LAND,
@ -47,13 +51,15 @@ enum eSound : uint16
SOUND_FIGHT_PUNCH_FROM_BEHIND_42, SOUND_FIGHT_PUNCH_FROM_BEHIND_42,
SOUND_FIGHT_KNEE_OR_KICK_43, SOUND_FIGHT_KNEE_OR_KICK_43,
SOUND_FIGHT_KICK_44, SOUND_FIGHT_KICK_44,
SOUND_2D, SOUND_49,
SOUND_WEAPON_BAT_ATTACK, SOUND_WEAPON_BAT_ATTACK,
SOUND_WEAPON_UNK_MELEE_ATTACK,
SOUND_WEAPON_CHAINSAW_ATTACK,
SOUND_WEAPON_CHAINSAW_IDLE,
SOUND_WEAPON_CHAINSAW_MADECONTACT,
SOUND_WEAPON_SHOT_FIRED, SOUND_WEAPON_SHOT_FIRED,
SOUND_WEAPON_RELOAD, SOUND_WEAPON_RELOAD,
SOUND_WEAPON_AK47_BULLET_ECHO, SOUND_WEAPON_AK47_BULLET_ECHO,
SOUND_WEAPON_UZI_BULLET_ECHO,
SOUND_WEAPON_M16_BULLET_ECHO,
SOUND_WEAPON_FLAMETHROWER_FIRE, SOUND_WEAPON_FLAMETHROWER_FIRE,
SOUND_WEAPON_SNIPER_SHOT_NO_ZOOM, SOUND_WEAPON_SNIPER_SHOT_NO_ZOOM,
SOUND_WEAPON_ROCKET_SHOT_NO_ZOOM, SOUND_WEAPON_ROCKET_SHOT_NO_ZOOM,
@ -66,8 +72,8 @@ enum eSound : uint16
SOUND_GARAGE_BOMB1_SET, SOUND_GARAGE_BOMB1_SET,
SOUND_GARAGE_BOMB2_SET, SOUND_GARAGE_BOMB2_SET,
SOUND_GARAGE_BOMB3_SET, SOUND_GARAGE_BOMB3_SET,
SOUND_40, SOUND_70,
SOUND_41, SOUND_71,
SOUND_GARAGE_VEHICLE_DECLINED, SOUND_GARAGE_VEHICLE_DECLINED,
SOUND_GARAGE_VEHICLE_ACCEPTED, SOUND_GARAGE_VEHICLE_ACCEPTED,
SOUND_GARAGE_DOOR_CLOSED, SOUND_GARAGE_DOOR_CLOSED,
@ -76,8 +82,8 @@ enum eSound : uint16
SOUND_PICKUP_WEAPON_BOUGHT, SOUND_PICKUP_WEAPON_BOUGHT,
SOUND_PICKUP_WEAPON, SOUND_PICKUP_WEAPON,
SOUND_PICKUP_HEALTH, SOUND_PICKUP_HEALTH,
SOUND_4A, SOUND_80,
SOUND_4B, SOUND_81,
SOUND_PICKUP_ADRENALINE, SOUND_PICKUP_ADRENALINE,
SOUND_PICKUP_ARMOUR, SOUND_PICKUP_ARMOUR,
SOUND_PICKUP_BONUS, SOUND_PICKUP_BONUS,
@ -87,7 +93,7 @@ enum eSound : uint16
SOUND_PICKUP_PACMAN_PACKAGE, SOUND_PICKUP_PACMAN_PACKAGE,
SOUND_PICKUP_FLOAT_PACKAGE, SOUND_PICKUP_FLOAT_PACKAGE,
SOUND_BOMB_TIMED_ACTIVATED, SOUND_BOMB_TIMED_ACTIVATED,
SOUND_55, SOUND_91,
SOUND_BOMB_ONIGNITION_ACTIVATED, SOUND_BOMB_ONIGNITION_ACTIVATED,
SOUND_BOMB_TICK, SOUND_BOMB_TICK,
SOUND_RAMPAGE_START, SOUND_RAMPAGE_START,
@ -99,48 +105,62 @@ enum eSound : uint16
SOUND_EVIDENCE_PICKUP, SOUND_EVIDENCE_PICKUP,
SOUND_UNLOAD_GOLD, SOUND_UNLOAD_GOLD,
SOUND_PAGER, SOUND_PAGER,
SOUND_PED_DEATH, // 103 in VC SOUND_PED_DEATH,
SOUND_PED_DAMAGE, // 104 in VC SOUND_PED_DAMAGE,
SOUND_PED_HIT, // 105 in VC SOUND_PED_HIT,
SOUND_PED_LAND, // hopefully 106 in VC SOUND_PED_LAND,
SOUND_PED_BULLET_HIT, SOUND_PED_BULLET_HIT,
SOUND_PED_BOMBER, SOUND_PED_BURNING,
SOUND_PED_BURNING, // 108 in VC SOUND_PED_PLAYER_REACTTOCOP,
SOUND_PED_ARREST_FBI,
SOUND_PED_ARREST_SWAT,
SOUND_PED_ARREST_COP, SOUND_PED_ARREST_COP,
SOUND_111,
SOUND_PED_COP_HELIPILOTPHRASE,
SOUND_PED_PULLOUTWEAPON,
SOUND_PED_HELI_PLAYER_FOUND, SOUND_PED_HELI_PLAYER_FOUND,
SOUND_115,
SOUND_PED_ON_FIRE,
SOUND_PED_AIMING,
SOUND_PED_HANDS_UP, SOUND_PED_HANDS_UP,
SOUND_PED_HANDS_COWER, SOUND_PED_HANDS_COWER,
SOUND_PED_FLEE_SPRINT, // 120 in VC SOUND_PED_FLEE_SPRINT,
SOUND_PED_CAR_JACKING, SOUND_PED_CAR_JACKING,
SOUND_PED_MUGGING, SOUND_PED_MUGGING,
SOUND_PED_CAR_JACKED, SOUND_PED_CAR_JACKED,
SOUND_PED_ROBBED, SOUND_PED_ROBBED,
SOUND_PED_TAXI_WAIT, // 137 in VC SOUND_PED_ACCIDENTREACTION1,
SOUND_PED_UNK_126,
SOUND_PED_PLAYER_AFTERSEX,
SOUND_PED_PLAYER_BEFORESEX,
SOUND_PED_COP_UNK_129, // also used for medics
SOUND_PED_COP_MANYCOPSAROUND, // also used for medics
SOUND_PED_GUNAIMEDAT2,
SOUND_PED_COP_ALONE, // also used for medics
SOUND_PED_GUNAIMEDAT3,
SOUND_PED_COP_REACTION,
SOUND_PED_COP_LITTLECOPSAROUND, // also used for medics
SOUND_PED_PLAYER_FARFROMCOPS, // also used for medics
SOUND_PED_TAXI_WAIT,
SOUND_PED_ATTACK, SOUND_PED_ATTACK,
SOUND_PED_DEFEND, SOUND_PED_DEFEND,
SOUND_PED_PURSUIT_ARMY, SOUND_140,
SOUND_PED_PURSUIT_FBI,
SOUND_PED_PURSUIT_SWAT,
SOUND_PED_PURSUIT_COP,
SOUND_PED_HEALING,
SOUND_PED_7B,
SOUND_PED_LEAVE_VEHICLE, SOUND_PED_LEAVE_VEHICLE,
SOUND_PED_EVADE, // 142 in VC SOUND_PED_EVADE,
SOUND_PED_FLEE_RUN, SOUND_PED_FLEE_RUN,
SOUND_PED_CAR_COLLISION, // 144-145-146 in VC SOUND_PED_CAR_COLLISION,
SOUND_PED_BOAT_COLLISION,
SOUND_PED_HORN_ACTIVE,
SOUND_PED_147,
SOUND_PED_SOLICIT, SOUND_PED_SOLICIT,
SOUND_PED_149,
SOUND_PED_150,
SOUND_PED_EXTINGUISHING_FIRE, SOUND_PED_EXTINGUISHING_FIRE,
SOUND_PED_WAIT_DOUBLEBACK, SOUND_PED_WAIT_DOUBLEBACK,
SOUND_153,
SOUND_PED_CHAT_SEXY, SOUND_PED_CHAT_SEXY,
SOUND_PED_CHAT_EVENT, SOUND_PED_CHAT_EVENT,
SOUND_PED_PED_COLLISION,
SOUND_PED_CHAT, SOUND_PED_CHAT,
SOUND_PED_BODYCAST_HIT,
SOUND_PED_TAXI_CALL, SOUND_PED_TAXI_CALL,
SOUND_INJURED_PED_MALE_OUCH,
SOUND_INJURED_PED_FEMALE,
SOUND_INJURED_PED_MALE_PRISON,
SOUND_RACE_START_3, SOUND_RACE_START_3,
SOUND_RACE_START_2, SOUND_RACE_START_2,
SOUND_RACE_START_1, SOUND_RACE_START_1,
@ -151,25 +171,43 @@ enum eSound : uint16
SOUND_CAR_PED_COLLISION, SOUND_CAR_PED_COLLISION,
SOUND_CLOCK_TICK, SOUND_CLOCK_TICK,
SOUND_PART_MISSION_COMPLETE, SOUND_PART_MISSION_COMPLETE,
SOUND_FRONTEND_MENU_STARTING, SOUND_FRONTEND_MENU_STARTING, // same with SOUND_HUD_SOUND
// TODO(Miami): What are 170-175??
SOUND_FRONTEND_NO_RADIO = 176, // those 3 are all same sound
SOUND_FRONTEND_RADIO_CHANGE,
SOUND_FRONTEND_RADIO_CHANGE_2,
SOUND_HUD_SOUND,
SOUND_180,
SOUND_181,
SOUND_182,
SOUND_LIGHTNING,
SOUND_BULLETTRACE_1,
SOUND_BULLETTRACE_2,
SOUND_186, // makes same sound with 40
SOUND_187, // makes same sound with 46
SOUND_MELEE_ATTACK_START,
SOUND_189,
SOUND_WEAPON_MINIGUN_ATTACK,
SOUND_WEAPON_MINIGUN_2,
SOUND_WEAPON_MINIGUN_3,
SOUND_AMMUNATION_IMRAN_ARM_BOMB,
SOUND_194,
// TODO(Miami): They're frontend sounds but names are copy-paste and incorrect
SOUND_FRONTEND_MENU_COMPLETED, SOUND_FRONTEND_MENU_COMPLETED,
SOUND_FRONTEND_MENU_DENIED, SOUND_FRONTEND_FAIL,
SOUND_FRONTEND_MENU_SUCCESS, SOUND_FRONTEND_MENU_SUCCESS,
SOUND_FRONTEND_EXIT, SOUND_FRONTEND_EXIT,
SOUND_9A,
SOUND_9B,
SOUND_FRONTEND_AUDIO_TEST, SOUND_FRONTEND_AUDIO_TEST,
SOUND_FRONTEND_FAIL,
SOUND_FRONTEND_NO_RADIO, SOUND_INJURED_PED_MALE_OUCH,
SOUND_FRONTEND_RADIO_CHANGE, SOUND_INJURED_PED_FEMALE,
SOUND_A0, SOUND_SET_202,
SOUND_AMMUNATION_WELCOME_1, SOUND_SET_203,
SOUND_AMMUNATION_WELCOME_2, SOUND_TOTAL_SOUNDS = 204,
SOUND_AMMUNATION_WELCOME_3, SOUND_NO_SOUND = 205,
SOUND_LIGHTNING,
SOUND_A5,
SOUND_TOTAL_SOUNDS,
SOUND_NO_SOUND,
}; };

View file

@ -23,7 +23,6 @@ CPathFind ThePaths;
#define NUMDETACHED_PEDS 1214 #define NUMDETACHED_PEDS 1214
#define NUMTEMPEXTERNALNODES 4600 #define NUMTEMPEXTERNALNODES 4600
CPathInfoForObject *InfoForTileCars; CPathInfoForObject *InfoForTileCars;
CPathInfoForObject *InfoForTilePeds; CPathInfoForObject *InfoForTilePeds;
@ -1861,6 +1860,15 @@ CPathFind::DisplayPathData(void)
} }
} }
CVector
CPathFind::TakeWidthIntoAccountForWandering(CPathNode* nextNode, uint16 random)
{
CVector pos = nextNode->GetPosition();
float newX = (nextNode->GetPedNodeWidth() * ((random % 16) - 7)) + pos.x;
float newY = (nextNode->GetPedNodeWidth() * (((random / 16) % 16) - 7)) + pos.y;
return CVector(newX, newY, pos.z);
}
CPathNode* CPathNode*
CPathFind::GetNode(int16 index) CPathFind::GetNode(int16 index)
{ {

View file

@ -62,7 +62,7 @@ struct CPathNode
int16 z; int16 z;
int16 distance; // in path search int16 distance; // in path search
int16 firstLink; int16 firstLink;
int8 width; uint8 width;
int8 group; int8 group;
uint8 numLinks : 4; uint8 numLinks : 4;
@ -89,6 +89,7 @@ struct CPathNode
float GetZ(void) { return z/8.0f; } float GetZ(void) { return z/8.0f; }
bool HasDivider(void) { return width != 0; } bool HasDivider(void) { return width != 0; }
float GetDividerWidth(void) { return width/(2*8.0f); } float GetDividerWidth(void) { return width/(2*8.0f); }
float GetPedNodeWidth(void) { return width*(31.f/(500.f * 8.f)); }
CPathNode *GetPrev(void); CPathNode *GetPrev(void);
CPathNode *GetNext(void); CPathNode *GetNext(void);
void SetPrev(CPathNode *node); void SetPrev(CPathNode *node);
@ -253,6 +254,8 @@ public:
void Save(uint8 *buf, uint32 *size); void Save(uint8 *buf, uint32 *size);
void Load(uint8 *buf, uint32 size); void Load(uint8 *buf, uint32 size);
static CVector TakeWidthIntoAccountForWandering(CPathNode*, uint16);
CPathNode *GetNode(int16 index); CPathNode *GetNode(int16 index);
int16 GetIndex(CPathNode *node); int16 GetIndex(CPathNode *node);

View file

@ -9913,13 +9913,21 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command)
StoreParameters(&m_nIp, 3); StoreParameters(&m_nIp, 3);
return 0; return 0;
case COMMAND_ATTACH_CHAR_TO_CAR: case COMMAND_ATTACH_CHAR_TO_CAR:
// TODO(MIAMI) {
assert(0); CollectParameters(&m_nIp, 8);
CPed *pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
CVehicle *pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]);
pPed->AttachPedToEntity(pVehicle, *(CVector*)&ScriptParams[2], ScriptParams[5], DEGTORAD(ScriptParams[6]), (eWeaponType)ScriptParams[7]);
return 0; return 0;
}
case COMMAND_DETACH_CHAR_FROM_CAR: case COMMAND_DETACH_CHAR_FROM_CAR:
// TODO(MIAMI) {
assert(0); CollectParameters(&m_nIp, 1);
CPed *pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
if (pPed && pPed->m_attachedTo)
pPed->DettachPedFromEntity();
return 0; return 0;
}
case COMMAND_SET_CAR_CHANGE_LANE: // for some reason changed in SA case COMMAND_SET_CAR_CHANGE_LANE: // for some reason changed in SA
{ {
CollectParameters(&m_nIp, 2); CollectParameters(&m_nIp, 2);
@ -10964,14 +10972,15 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command)
{ {
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
assert(pPed); pPed->PedShuffle();
debug("SET_CHAR_SHUFFLE_INTO_DRIVERS_SEAT is not implemented\n");
return 0; return 0;
} }
case COMMAND_ATTACH_CHAR_TO_OBJECT: case COMMAND_ATTACH_CHAR_TO_OBJECT:
{ {
CollectParameters(&m_nIp, 8); CollectParameters(&m_nIp, 8);
debug("ATTACH_CHAR_TO_OBJECT is not implemented\n"); CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
CObject* pObject = CPools::GetObjectPool()->GetAt(ScriptParams[1]);
pPed->AttachPedToEntity(pObject, *(CVector*)&ScriptParams[2], ScriptParams[5], DEGTORAD(ScriptParams[6]), (eWeaponType)ScriptParams[7]);
return 0; return 0;
} }
case COMMAND_SET_CHAR_AS_PLAYER_FRIEND: case COMMAND_SET_CHAR_AS_PLAYER_FRIEND:
@ -11309,7 +11318,11 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command)
case COMMAND_SET_CHAR_ANSWERING_MOBILE: case COMMAND_SET_CHAR_ANSWERING_MOBILE:
{ {
CollectParameters(&m_nIp, 2); CollectParameters(&m_nIp, 2);
debug("SET_CHAR_ANSWERING_MOBILE not implemented\n"); // TODO(MIAMI) CPed* pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]);
if (ScriptParams[1])
pPed->SetAnswerMobile();
else
pPed->ClearAnswerMobile();
return 0; return 0;
} }
case COMMAND_SET_PLAYER_DRUNKENNESS: case COMMAND_SET_PLAYER_DRUNKENNESS:
@ -11988,7 +12001,7 @@ int8 CRunningScript::ProcessCommands1400To1499(int32 command)
case COMMAND_ADD_BIG_GUN_FLASH: case COMMAND_ADD_BIG_GUN_FLASH:
{ {
CollectParameters(&m_nIp, 6); CollectParameters(&m_nIp, 6);
debug("ADD_BIG_GUN_FLASH not implemented\n"); // TODO(MIAMI) CWeapon::AddGunFlashBigGuns(*(CVector*)&ScriptParams[0], *(CVector*)&ScriptParams[3]);
return 0; return 0;
} }
case COMMAND_HAS_CHAR_BOUGHT_ICE_CREAM: case COMMAND_HAS_CHAR_BOUGHT_ICE_CREAM:

View file

@ -319,7 +319,7 @@ CMenuManager::PageUpList(bool playSoundOnSuccess)
if (m_nTotalListRow > MAX_VISIBLE_LIST_ROW) { if (m_nTotalListRow > MAX_VISIBLE_LIST_ROW) {
if (m_nFirstVisibleRowOnList > 0) { if (m_nFirstVisibleRowOnList > 0) {
if(playSoundOnSuccess) if(playSoundOnSuccess)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
m_nFirstVisibleRowOnList = Max(0, m_nFirstVisibleRowOnList - MAX_VISIBLE_LIST_ROW); m_nFirstVisibleRowOnList = Max(0, m_nFirstVisibleRowOnList - MAX_VISIBLE_LIST_ROW);
m_nSelectedListRow = Min(m_nSelectedListRow, m_nFirstVisibleRowOnList + MAX_VISIBLE_LIST_ROW - 1); m_nSelectedListRow = Min(m_nSelectedListRow, m_nFirstVisibleRowOnList + MAX_VISIBLE_LIST_ROW - 1);
@ -337,7 +337,7 @@ CMenuManager::PageDownList(bool playSoundOnSuccess)
if (m_nTotalListRow > MAX_VISIBLE_LIST_ROW) { if (m_nTotalListRow > MAX_VISIBLE_LIST_ROW) {
if (m_nFirstVisibleRowOnList < m_nTotalListRow - MAX_VISIBLE_LIST_ROW) { if (m_nFirstVisibleRowOnList < m_nTotalListRow - MAX_VISIBLE_LIST_ROW) {
if(playSoundOnSuccess) if(playSoundOnSuccess)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
m_nFirstVisibleRowOnList = Min(m_nFirstVisibleRowOnList + MAX_VISIBLE_LIST_ROW, m_nTotalListRow - MAX_VISIBLE_LIST_ROW); m_nFirstVisibleRowOnList = Min(m_nFirstVisibleRowOnList + MAX_VISIBLE_LIST_ROW, m_nTotalListRow - MAX_VISIBLE_LIST_ROW);
m_nSelectedListRow = Max(m_nSelectedListRow, m_nFirstVisibleRowOnList); m_nSelectedListRow = Max(m_nSelectedListRow, m_nFirstVisibleRowOnList);
@ -1297,13 +1297,14 @@ CMenuManager::DrawStandardMenus(bool drawCurrScreen)
} }
#ifdef IMPROVED_VIDEOMODE #ifdef IMPROVED_VIDEOMODE
if (m_nSelectedScreenMode != m_nPrefsWindowed) { if (m_nSelectedScreenMode != m_nPrefsWindowed) {
if (strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "SCRFOR") != 0 if (strcmp(aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_EntryName, "FED_POS") != 0
&& m_nCurrScreen == MENUPAGE_GRAPHICS_SETTINGS) { && m_nCurrScreen == MENUPAGE_GRAPHICS_SETTINGS) {
m_nSelectedScreenMode = m_nPrefsWindowed; m_nSelectedScreenMode = m_nPrefsWindowed;
} }
} }
#endif #endif
// TODO(Miami): check
// Sliders // Sliders
int lastActiveBarX; int lastActiveBarX;
switch (aScreens[m_nCurrScreen].m_aEntries[i].m_Action) { switch (aScreens[m_nCurrScreen].m_aEntries[i].m_Action) {
@ -1935,7 +1936,7 @@ CMenuManager::DrawControllerSetupScreen()
float curOptY = i * rowHeight + yStart; float curOptY = i * rowHeight + yStart;
if (m_nMousePosY > MENU_Y(curOptY) && m_nMousePosY < MENU_Y(rowHeight + curOptY)) { if (m_nMousePosY > MENU_Y(curOptY) && m_nMousePosY < MENU_Y(rowHeight + curOptY)) {
if (m_nPrevOption != i && m_nCurrExLayer == HOVEROPTION_LIST) if (m_nPrevOption != i && m_nCurrExLayer == HOVEROPTION_LIST)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
m_nPrevOption = i; m_nPrevOption = i;
if (m_nMouseOldPosX != m_nMousePosX || m_nMouseOldPosY != m_nMousePosY) { if (m_nMouseOldPosX != m_nMousePosX || m_nMouseOldPosY != m_nMousePosY) {
@ -1949,7 +1950,7 @@ CMenuManager::DrawControllerSetupScreen()
if (m_nMousePosX > MENU_X_LEFT_ALIGNED(0.0f) && m_nMousePosX < MENU_X_LEFT_ALIGNED(370.0f)) { if (m_nMousePosX > MENU_X_LEFT_ALIGNED(0.0f) && m_nMousePosX < MENU_X_LEFT_ALIGNED(370.0f)) {
#endif #endif
if (m_nSelectedContSetupColumn != CONTSETUP_PED_COLUMN && m_nCurrExLayer == HOVEROPTION_LIST) if (m_nSelectedContSetupColumn != CONTSETUP_PED_COLUMN && m_nCurrExLayer == HOVEROPTION_LIST)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
m_nSelectedContSetupColumn = CONTSETUP_PED_COLUMN; m_nSelectedContSetupColumn = CONTSETUP_PED_COLUMN;
#ifdef FIX_BUGS #ifdef FIX_BUGS
@ -1958,7 +1959,7 @@ CMenuManager::DrawControllerSetupScreen()
} else if (m_nMousePosX > MENU_X_LEFT_ALIGNED(370.0f) && m_nMousePosX < SCREEN_WIDTH) { } else if (m_nMousePosX > MENU_X_LEFT_ALIGNED(370.0f) && m_nMousePosX < SCREEN_WIDTH) {
#endif #endif
if (m_nSelectedContSetupColumn != CONTSETUP_VEHICLE_COLUMN && m_nCurrExLayer == HOVEROPTION_LIST) if (m_nSelectedContSetupColumn != CONTSETUP_VEHICLE_COLUMN && m_nCurrExLayer == HOVEROPTION_LIST)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
m_nSelectedContSetupColumn = CONTSETUP_VEHICLE_COLUMN; m_nSelectedContSetupColumn = CONTSETUP_VEHICLE_COLUMN;
} }
@ -2653,7 +2654,7 @@ CMenuManager::DrawPlayerSetupScreen()
SaveSettings(); SaveSettings();
} }
} else { } else {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
m_nCurrExLayer = HOVEROPTION_LIST; m_nCurrExLayer = HOVEROPTION_LIST;
m_nSelectedListRow = rowIdx; m_nSelectedListRow = rowIdx;
m_nHoverOption = HOVEROPTION_NOT_HOVERING; m_nHoverOption = HOVEROPTION_NOT_HOVERING;
@ -2809,7 +2810,7 @@ CMenuManager::DrawPlayerSetupScreen()
&& m_nMousePosY < SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM - 26)) && m_nMousePosY < SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM - 26))
|| m_nCurrExLayer == HOVEROPTION_BACK) { || m_nCurrExLayer == HOVEROPTION_BACK) {
if (m_nHoverOption != HOVEROPTION_BACK) if (m_nHoverOption != HOVEROPTION_BACK)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
m_nHoverOption = HOVEROPTION_BACK; m_nHoverOption = HOVEROPTION_BACK;
@ -2820,7 +2821,7 @@ CMenuManager::DrawPlayerSetupScreen()
&& m_nMousePosY < SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM - 26)) && m_nMousePosY < SCREEN_SCALE_FROM_BOTTOM(PLAYERSETUP_LIST_BOTTOM - 26))
|| m_nCurrExLayer == HOVEROPTION_USESKIN) { || m_nCurrExLayer == HOVEROPTION_USESKIN) {
if (m_nHoverOption != HOVEROPTION_USESKIN) if (m_nHoverOption != HOVEROPTION_USESKIN)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
m_nHoverOption = HOVEROPTION_USESKIN; m_nHoverOption = HOVEROPTION_USESKIN;
@ -3588,7 +3589,7 @@ CMenuManager::ProcessButtonPresses(void)
++m_nPrevOption; ++m_nPrevOption;
} }
m_nOptionHighlightTransitionBlend = 0; m_nOptionHighlightTransitionBlend = 0;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
} }
} }
@ -3641,7 +3642,7 @@ CMenuManager::ProcessButtonPresses(void)
} }
if (CPad::GetPad(0)->GetTabJustDown()) { if (CPad::GetPad(0)->GetTabJustDown()) {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
m_bShowMouse = false; m_bShowMouse = false;
switch (m_nCurrExLayer) { switch (m_nCurrExLayer) {
case HOVEROPTION_BACK: case HOVEROPTION_BACK:
@ -3677,7 +3678,7 @@ CMenuManager::ProcessButtonPresses(void)
if (!m_bPressedUpOnList) { if (!m_bPressedUpOnList) {
m_bPressedUpOnList = true; m_bPressedUpOnList = true;
lastTimeClickedScrollButton = CTimer::GetTimeInMillisecondsPauseMode(); lastTimeClickedScrollButton = CTimer::GetTimeInMillisecondsPauseMode();
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
ScrollUpListByOne(); ScrollUpListByOne();
} }
} else { } else {
@ -3699,7 +3700,7 @@ CMenuManager::ProcessButtonPresses(void)
if (!m_bPressedDownOnList) { if (!m_bPressedDownOnList) {
m_bPressedDownOnList = true; m_bPressedDownOnList = true;
lastTimeClickedScrollButton = CTimer::GetTimeInMillisecondsPauseMode(); lastTimeClickedScrollButton = CTimer::GetTimeInMillisecondsPauseMode();
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
ScrollDownListByOne(); ScrollDownListByOne();
} }
} else { } else {
@ -3715,7 +3716,7 @@ CMenuManager::ProcessButtonPresses(void)
m_bPressedPgUpOnList = true; m_bPressedPgUpOnList = true;
lastTimeClickedScrollButton = CTimer::GetTimeInMillisecondsPauseMode(); lastTimeClickedScrollButton = CTimer::GetTimeInMillisecondsPauseMode();
m_bShowMouse = false; m_bShowMouse = false;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
PageUpList(false); PageUpList(false);
} }
} }
@ -3727,14 +3728,14 @@ CMenuManager::ProcessButtonPresses(void)
m_bPressedPgDnOnList = true; m_bPressedPgDnOnList = true;
lastTimeClickedScrollButton = CTimer::GetTimeInMillisecondsPauseMode(); lastTimeClickedScrollButton = CTimer::GetTimeInMillisecondsPauseMode();
m_bShowMouse = false; m_bShowMouse = false;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
PageDownList(false); PageDownList(false);
} }
} }
if (CPad::GetPad(0)->GetHome()) { if (CPad::GetPad(0)->GetHome()) {
m_nCurrExLayer = HOVEROPTION_LIST; m_nCurrExLayer = HOVEROPTION_LIST;
m_bShowMouse = false; m_bShowMouse = false;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
if (m_nTotalListRow >= MAX_VISIBLE_LIST_ROW) { if (m_nTotalListRow >= MAX_VISIBLE_LIST_ROW) {
m_nFirstVisibleRowOnList = 0; m_nFirstVisibleRowOnList = 0;
} }
@ -3744,7 +3745,7 @@ CMenuManager::ProcessButtonPresses(void)
if (CPad::GetPad(0)->GetEnd()) { if (CPad::GetPad(0)->GetEnd()) {
m_nCurrExLayer = HOVEROPTION_LIST; m_nCurrExLayer = HOVEROPTION_LIST;
m_bShowMouse = false; m_bShowMouse = false;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
if (m_nTotalListRow >= MAX_VISIBLE_LIST_ROW) { if (m_nTotalListRow >= MAX_VISIBLE_LIST_ROW) {
m_nFirstVisibleRowOnList = m_nTotalListRow - MAX_VISIBLE_LIST_ROW; m_nFirstVisibleRowOnList = m_nTotalListRow - MAX_VISIBLE_LIST_ROW;
} }
@ -3838,12 +3839,12 @@ CMenuManager::ProcessButtonPresses(void)
} else { } else {
if (CPad::GetPad(0)->GetDownJustDown() || CPad::GetPad(0)->GetAnaloguePadDown() || CPad::GetPad(0)->GetDPadDownJustDown()) { if (CPad::GetPad(0)->GetDownJustDown() || CPad::GetPad(0)->GetAnaloguePadDown() || CPad::GetPad(0)->GetDPadDownJustDown()) {
m_bShowMouse = false; m_bShowMouse = false;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
goDown = true; goDown = true;
m_nOptionHighlightTransitionBlend = 0; m_nOptionHighlightTransitionBlend = 0;
} else if (CPad::GetPad(0)->GetUpJustDown() || CPad::GetPad(0)->GetAnaloguePadUp() || CPad::GetPad(0)->GetDPadUpJustDown()) { } else if (CPad::GetPad(0)->GetUpJustDown() || CPad::GetPad(0)->GetAnaloguePadUp() || CPad::GetPad(0)->GetDPadUpJustDown()) {
m_bShowMouse = false; m_bShowMouse = false;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
goUp = true; goUp = true;
m_nOptionHighlightTransitionBlend = 0; m_nOptionHighlightTransitionBlend = 0;
} }
@ -4118,14 +4119,14 @@ CMenuManager::ProcessButtonPresses(void)
#ifdef PS2_LIKE_MENU #ifdef PS2_LIKE_MENU
if (CPad::GetPad(0)->GetLeftMouseJustDown() && hoveredBottomBarOption != -1) { if (CPad::GetPad(0)->GetLeftMouseJustDown() && hoveredBottomBarOption != -1) {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
bottomBarActive = false; bottomBarActive = false;
curBottomBarOption = hoveredBottomBarOption; curBottomBarOption = hoveredBottomBarOption;
ChangeScreen(bbNames[curBottomBarOption].screenId, 0, true, false); ChangeScreen(bbNames[curBottomBarOption].screenId, 0, true, false);
return; return;
} else if (bottomBarActive) { } else if (bottomBarActive) {
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetCrossJustDown()) { if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetCrossJustDown()) {
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
bottomBarActive = false; bottomBarActive = false;
// If there's a menu change with fade ongoing, finish it now // If there's a menu change with fade ongoing, finish it now
@ -4135,7 +4136,7 @@ CMenuManager::ProcessButtonPresses(void)
} else if (CPad::GetPad(0)->GetLeftJustDown() || CPad::GetPad(0)->GetAnaloguePadLeft() || CPad::GetPad(0)->GetDPadLeftJustDown() } else if (CPad::GetPad(0)->GetLeftJustDown() || CPad::GetPad(0)->GetAnaloguePadLeft() || CPad::GetPad(0)->GetDPadLeftJustDown()
|| CPad::GetPad(0)->GetUpJustDown() || CPad::GetPad(0)->GetAnaloguePadUp() || CPad::GetPad(0)->GetDPadUpJustDown()) { || CPad::GetPad(0)->GetUpJustDown() || CPad::GetPad(0)->GetAnaloguePadUp() || CPad::GetPad(0)->GetDPadUpJustDown()) {
m_bShowMouse = false; m_bShowMouse = false;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
if (curBottomBarOption > 0) if (curBottomBarOption > 0)
curBottomBarOption--; curBottomBarOption--;
ChangeScreen(bbNames[curBottomBarOption].screenId, 0, true, true); ChangeScreen(bbNames[curBottomBarOption].screenId, 0, true, true);
@ -4143,7 +4144,7 @@ CMenuManager::ProcessButtonPresses(void)
} else if (CPad::GetPad(0)->GetRightJustDown() || CPad::GetPad(0)->GetAnaloguePadRight() || CPad::GetPad(0)->GetDPadRightJustDown() } else if (CPad::GetPad(0)->GetRightJustDown() || CPad::GetPad(0)->GetAnaloguePadRight() || CPad::GetPad(0)->GetDPadRightJustDown()
|| CPad::GetPad(0)->GetDownJustDown() || CPad::GetPad(0)->GetAnaloguePadDown() || CPad::GetPad(0)->GetDPadDownJustDown()) { || CPad::GetPad(0)->GetDownJustDown() || CPad::GetPad(0)->GetAnaloguePadDown() || CPad::GetPad(0)->GetDPadDownJustDown()) {
m_bShowMouse = false; m_bShowMouse = false;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
if (curBottomBarOption < bbTabCount-1) if (curBottomBarOption < bbTabCount-1)
curBottomBarOption++; curBottomBarOption++;
ChangeScreen(bbNames[curBottomBarOption].screenId, 0, true, true); ChangeScreen(bbNames[curBottomBarOption].screenId, 0, true, true);
@ -4703,7 +4704,7 @@ CMenuManager::ProcessButtonPresses(void)
case MENUACTION_SCREENRES: case MENUACTION_SCREENRES:
if (m_bGameNotLoaded) { if (m_bGameNotLoaded) {
RwChar** videoMods = _psGetVideoModeList(); RwChar** videoMods = _psGetVideoModeList();
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
if (changeValueBy > 0) { if (changeValueBy > 0) {
do { do {
++m_nDisplayVideoMode; ++m_nDisplayVideoMode;
@ -4723,7 +4724,7 @@ CMenuManager::ProcessButtonPresses(void)
break; break;
#ifdef IMPROVED_VIDEOMODE #ifdef IMPROVED_VIDEOMODE
case MENUACTION_SCREENMODE: case MENUACTION_SCREENMODE:
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
m_nSelectedScreenMode = !m_nSelectedScreenMode; m_nSelectedScreenMode = !m_nSelectedScreenMode;
break; break;
#endif #endif
@ -4732,7 +4733,7 @@ CMenuManager::ProcessButtonPresses(void)
m_nPrefsAudio3DProviderIndex += changeValueBy; m_nPrefsAudio3DProviderIndex += changeValueBy;
m_nPrefsAudio3DProviderIndex = clamp(m_nPrefsAudio3DProviderIndex, 0, DMAudio.GetNum3DProvidersAvailable() - 1); m_nPrefsAudio3DProviderIndex = clamp(m_nPrefsAudio3DProviderIndex, 0, DMAudio.GetNum3DProvidersAvailable() - 1);
} }
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
break; break;
case MENUACTION_SPEAKERCONF: case MENUACTION_SPEAKERCONF:
if (m_nPrefsAudio3DProviderIndex != INVALID_AUDIO_PROVIDER) { if (m_nPrefsAudio3DProviderIndex != INVALID_AUDIO_PROVIDER) {
@ -4757,7 +4758,7 @@ CMenuManager::ProcessButtonPresses(void)
} else { } else {
m_nSelectedContSetupColumn = CONTSETUP_VEHICLE_COLUMN; m_nSelectedContSetupColumn = CONTSETUP_VEHICLE_COLUMN;
} }
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_DENIED, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_COMPLETED, 0);
} }
} }
} }

View file

@ -344,7 +344,7 @@ enum eCheckHover
enum enum
{ {
#ifdef LEGACY_MENU_OPTIONS #ifdef LEGACY_MENU_OPTIONS
NUM_MENUROWS = 13, NUM_MENUROWS = 14,
#else #else
NUM_MENUROWS = 12, NUM_MENUROWS = 12,
#endif #endif

View file

@ -57,8 +57,14 @@ CMenuScreen aScreens[] = {
MENUACTION_RADARMODE, "FED_RDR", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS, 40, 228 + Y_OFFSET, MENUALIGN_LEFT, MENUACTION_RADARMODE, "FED_RDR", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS, 40, 228 + Y_OFFSET, MENUALIGN_LEFT,
MENUACTION_HUD, "FED_HUD", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS, 40, 253 + Y_OFFSET, MENUALIGN_LEFT, MENUACTION_HUD, "FED_HUD", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS, 40, 253 + Y_OFFSET, MENUALIGN_LEFT,
MENUACTION_SCREENRES, "FED_RES", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS, 40, 278 + Y_OFFSET, MENUALIGN_LEFT, MENUACTION_SCREENRES, "FED_RES", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS, 40, 278 + Y_OFFSET, MENUALIGN_LEFT,
#ifdef IMPROVED_VIDEOMODE
MENUACTION_SCREENMODE, "FED_POS", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS, 40, 303 + Y_OFFSET, MENUALIGN_LEFT,
MENUACTION_RESTOREDEF, "FET_DEF", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS, 320, 328 + Y_OFFSET, MENUALIGN_CENTER,
MENUACTION_GOBACK, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE, 320, 353 + Y_OFFSET, MENUALIGN_CENTER,
#else
MENUACTION_RESTOREDEF, "FET_DEF", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS, 320, 303 + Y_OFFSET, MENUALIGN_CENTER, MENUACTION_RESTOREDEF, "FET_DEF", SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS, 320, 303 + Y_OFFSET, MENUALIGN_CENTER,
MENUACTION_GOBACK, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE, 320, 328 + Y_OFFSET, 3 MENUACTION_GOBACK, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE, 320, 328 + Y_OFFSET, MENUALIGN_CENTER,
#endif
}, },
#undef Y_OFFSET #undef Y_OFFSET
@ -75,7 +81,7 @@ CMenuScreen aScreens[] = {
// TODO(Miami): This is still my implementation // TODO(Miami): This is still my implementation
// MENUPAGE_MAP = 6 // MENUPAGE_MAP = 6
{ "FEG_MAP", MENUPAGE_NONE, 2, { "FEH_MAP", MENUPAGE_NONE, 2,
MENUACTION_UNK110, "", SAVESLOT_NONE, 0, 0, 0, 0, // to prevent cross/enter to go back MENUACTION_UNK110, "", SAVESLOT_NONE, 0, 0, 0, 0, // to prevent cross/enter to go back
MENUACTION_GOBACK, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE, 0, 0, 0, MENUACTION_GOBACK, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE, 0, 0, 0,
}, },

View file

@ -402,7 +402,7 @@ CPlayerInfo::Process(void)
else else
enterOrExitVeh = CPad::GetPad(0)->GetExitVehicle(); enterOrExitVeh = CPad::GetPad(0)->GetExitVehicle();
if (enterOrExitVeh && m_pPed->m_nPedState != PED_SNIPER_MODE && m_pPed->m_nPedState != PED_ROCKET_ODE) { if (enterOrExitVeh && m_pPed->m_nPedState != PED_SNIPER_MODE && m_pPed->m_nPedState != PED_ROCKET_MODE) {
if (m_pPed->bInVehicle) { if (m_pPed->bInVehicle) {
if (!m_pRemoteVehicle) { if (!m_pRemoteVehicle) {
CEntity *surfaceBelowVeh = m_pPed->m_pMyVehicle->m_pCurGroundEntity; CEntity *surfaceBelowVeh = m_pPed->m_pMyVehicle->m_pCurGroundEntity;

View file

@ -348,6 +348,7 @@ enum
MI_BODYPARTB, MI_BODYPARTB,
MI_AIRTRAIN_VLO = 257, MI_AIRTRAIN_VLO = 257,
MI_MOBILE = 258,
NUM_DEFAULT_MODELS = 300 NUM_DEFAULT_MODELS = 300
}; };

View file

@ -101,7 +101,7 @@ CCopPed::SetArrestPlayer(CPed *player)
{ {
if (!IsPedInControl() || !player) if (!IsPedInControl() || !player)
return; return;
/*
switch (m_nCopType) { switch (m_nCopType) {
case COP_FBI: case COP_FBI:
Say(SOUND_PED_ARREST_FBI); Say(SOUND_PED_ARREST_FBI);
@ -112,7 +112,7 @@ CCopPed::SetArrestPlayer(CPed *player)
default: default:
Say(SOUND_PED_ARREST_COP); Say(SOUND_PED_ARREST_COP);
break; break;
} } */
if (player->EnteringCar()) { if (player->EnteringCar()) {
if (CTimer::GetTimeInMilliseconds() > m_nPedStateTimer) if (CTimer::GetTimeInMilliseconds() > m_nPedStateTimer)
return; return;
@ -605,6 +605,7 @@ CCopPed::ProcessControl(void)
if (IsPedInControl()) if (IsPedInControl())
SetIdle(); SetIdle();
} }
/*
if (m_bIsInPursuit) { if (m_bIsInPursuit) {
if (player->m_nPedState != PED_ARRESTED && !player->DyingOrDead()) { if (player->m_nPedState != PED_ARRESTED && !player->DyingOrDead()) {
switch (m_nCopType) { switch (m_nCopType) {
@ -622,7 +623,7 @@ CCopPed::ProcessControl(void)
break; break;
} }
} }
} } */
if (IsPedInControl()) { if (IsPedInControl()) {
CopAI(); CopAI();

View file

@ -308,7 +308,7 @@ CEmergencyPed::MedicAI(void)
m_nLastPedState = PED_CPR; m_nLastPedState = PED_CPR;
SetLookFlag(m_pRevivedPed, 0); SetLookFlag(m_pRevivedPed, 0);
SetLookTimer(500); SetLookTimer(500);
Say(SOUND_PED_HEALING); //Say(SOUND_PED_HEALING);
if (m_pAttendedAccident->m_nMedicsPerformingCPR) { if (m_pAttendedAccident->m_nMedicsPerformingCPR) {
SetIdle(); SetIdle();
m_nEmergencyPedState = EMERGENCY_PED_STAND_STILL; m_nEmergencyPedState = EMERGENCY_PED_STAND_STILL;

File diff suppressed because it is too large Load diff

View file

@ -245,6 +245,7 @@ enum eObjective : uint32 {
enum { enum {
RANDOM_CHAR = 1, RANDOM_CHAR = 1,
MISSION_CHAR, MISSION_CHAR,
TODO_CHAR, // TODO(Miami)
}; };
enum PedLineUpPhase { enum PedLineUpPhase {
@ -281,7 +282,7 @@ enum PedState
PED_PURSUE, PED_PURSUE,
PED_FOLLOW_PATH, PED_FOLLOW_PATH,
PED_SNIPER_MODE, PED_SNIPER_MODE,
PED_ROCKET_ODE, PED_ROCKET_MODE,
PED_DUMMY, PED_DUMMY,
PED_PAUSE, PED_PAUSE,
PED_ATTACK, PED_ATTACK,
@ -301,12 +302,17 @@ enum PedState
PED_INVESTIGATE, PED_INVESTIGATE,
PED_STEP_AWAY, PED_STEP_AWAY,
PED_ON_FIRE, PED_ON_FIRE,
PED_SUN_BATHE,
PED_FLASH,
PED_JOG,
PED_ANSWER_MOBILE,
PED_UNKNOWN, // Same with IDLE, but also infects up to 5 peds with same pedType and WANDER_PATH, so they become stone too. HANG_OUT in Fire_Head's idb PED_UNKNOWN, // Same with IDLE, but also infects up to 5 peds with same pedType and WANDER_PATH, so they become stone too. HANG_OUT in Fire_Head's idb
PED_STATES_NO_AI, PED_STATES_NO_AI,
// One of these states isn't on PS2 - start PED_ABSEIL,
PED_SIT,
PED_JUMP, PED_JUMP,
PED_FALL, PED_FALL,
PED_GETUP, PED_GETUP,
@ -317,7 +323,6 @@ enum PedState
PED_ENTER_TRAIN, PED_ENTER_TRAIN,
PED_EXIT_TRAIN, PED_EXIT_TRAIN,
PED_ARREST_PLAYER, PED_ARREST_PLAYER,
// One of these states isn't on PS2 - end
PED_DRIVING, PED_DRIVING,
PED_PASSENGER, PED_PASSENGER,
@ -332,6 +337,7 @@ enum PedState
PED_EXIT_CAR, PED_EXIT_CAR,
PED_HANDS_UP, PED_HANDS_UP,
PED_ARRESTED, PED_ARRESTED,
PED_DEPLOY_STINGER
}; };
enum eMoveState { enum eMoveState {
@ -518,7 +524,6 @@ public:
uint16 m_nPathNodes; uint16 m_nPathNodes;
int16 m_nCurPathNode; int16 m_nCurPathNode;
int8 m_nPathDir; int8 m_nPathDir;
public:
CPathNode *m_pLastPathNode; CPathNode *m_pLastPathNode;
CPathNode *m_pNextPathNode; CPathNode *m_pNextPathNode;
float m_fHealth; float m_fHealth;
@ -559,6 +564,7 @@ public:
float m_fleeFromPosY; float m_fleeFromPosY;
CEntity *m_fleeFrom; CEntity *m_fleeFrom;
uint32 m_fleeTimer; uint32 m_fleeTimer;
CEntity* pThreatEx; // TODO(Miami): What is this?
CEntity* m_collidingEntityWhileFleeing; CEntity* m_collidingEntityWhileFleeing;
uint32 m_collidingThingTimer; uint32 m_collidingThingTimer;
CEntity *m_pCollidingEntity; CEntity *m_pCollidingEntity;
@ -825,6 +831,15 @@ public:
void RequestDelayedWeapon(); void RequestDelayedWeapon();
void AddInCarAnims(CVehicle* car, bool isDriver); void AddInCarAnims(CVehicle* car, bool isDriver);
bool CanBeDamagedByThisGangMember(CPed*); bool CanBeDamagedByThisGangMember(CPed*);
void AnswerMobile(void);
void BuyIceCream(void);
void CheckThreatValidity(void);
void ClearAnswerMobile(void);
void SetAnswerMobile(void);
void AttachPedToEntity(CEntity*, CVector, uint16, float, eWeaponType);
void DettachPedFromEntity();
void PedShuffle();
void DriveVehicle();
// Static methods // Static methods
static CVector GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float offset); static CVector GetLocalPositionToOpenCarDoor(CVehicle *veh, uint32 component, float offset);
@ -908,11 +923,7 @@ public:
void UpdatePosition(void); void UpdatePosition(void);
CObject *SpawnFlyingComponent(int, int8); CObject *SpawnFlyingComponent(int, int8);
void SetCarJack_AllClear(CVehicle*, uint32, uint32); void SetCarJack_AllClear(CVehicle*, uint32, uint32);
#ifdef VC_PED_PORTS
bool CanPedJumpThis(CEntity*, CVector*); bool CanPedJumpThis(CEntity*, CVector*);
#else
bool CanPedJumpThis(CEntity*);
#endif
void SetNewAttraction(CPedAttractor* pAttractor, const CVector& pos, float, float, int); void SetNewAttraction(CPedAttractor* pAttractor, const CVector& pos, float, float, int);
void ClearWaitState(void); void ClearWaitState(void);
@ -1063,6 +1074,8 @@ public:
#endif #endif
}; };
void FinishTalkingOnMobileCB(CAnimBlendAssociation* assoc, void* arg);
void StartTalkingOnMobileCB(CAnimBlendAssociation* assoc, void* arg);
void FinishFuckUCB(CAnimBlendAssociation *assoc, void *arg); void FinishFuckUCB(CAnimBlendAssociation *assoc, void *arg);
// TODO(Miami): Change those when Ped struct is done // TODO(Miami): Change those when Ped struct is done

View file

@ -46,7 +46,7 @@ CPlayerPed::CPlayerPed(void) : CPed(PEDTYPE_PLAYER1)
m_pWanted->Initialise(); m_pWanted->Initialise();
m_pArrestingCop = nil; m_pArrestingCop = nil;
m_currentWeapon = WEAPONTYPE_UNARMED; m_currentWeapon = WEAPONTYPE_UNARMED;
m_nSelectedWepSlot = WEAPONTYPE_UNARMED; m_nSelectedWepSlot = 0;
m_nSpeedTimer = 0; m_nSpeedTimer = 0;
m_bSpeedTimerFlag = false; m_bSpeedTimerFlag = false;
@ -1163,6 +1163,9 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
} }
#ifdef FREE_CAM #ifdef FREE_CAM
static int8 changedHeadingRate = 0;
if (changedHeadingRate == 2) changedHeadingRate = 1;
// Rotate player/arm when shooting. We don't have auto-rotation anymore // Rotate player/arm when shooting. We don't have auto-rotation anymore
if (CCamera::m_bUseMouse3rdPerson && CCamera::bFreeCam && if (CCamera::m_bUseMouse3rdPerson && CCamera::bFreeCam &&
m_nSelectedWepSlot == m_currentWeapon && m_nMoveState != PEDMOVE_SPRINT) { m_nSelectedWepSlot == m_currentWeapon && m_nMoveState != PEDMOVE_SPRINT) {
@ -1186,6 +1189,7 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
#endif #endif
} else { } else {
m_fRotationDest = limitedCam; m_fRotationDest = limitedCam;
changedHeadingRate = 2;
m_headingRate = 12.5f; m_headingRate = 12.5f;
// Anim. fix for shotgun, ak47 and m16 (we must finish rot. it quickly) // Anim. fix for shotgun, ak47 and m16 (we must finish rot. it quickly)
@ -1204,10 +1208,12 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
} }
} else if (weaponInfo->m_bCanAimWithArm) } else if (weaponInfo->m_bCanAimWithArm)
ClearPointGunAt(); ClearPointGunAt();
else
RestoreHeadingRate();
} }
} }
if (changedHeadingRate == 1) {
changedHeadingRate = 0;
RestoreHeadingRate();
}
#endif #endif
if (padUsed->GetTarget() && m_nSelectedWepSlot == m_currentWeapon && m_nMoveState != PEDMOVE_SPRINT) { if (padUsed->GetTarget() && m_nSelectedWepSlot == m_currentWeapon && m_nMoveState != PEDMOVE_SPRINT) {
@ -1453,7 +1459,7 @@ CPlayerPed::ProcessControl(void)
case PED_WANDER_PATH: case PED_WANDER_PATH:
case PED_PURSUE: case PED_PURSUE:
case PED_FOLLOW_PATH: case PED_FOLLOW_PATH:
case PED_ROCKET_ODE: case PED_ROCKET_MODE:
case PED_DUMMY: case PED_DUMMY:
case PED_PAUSE: case PED_PAUSE:
case PED_FACE_PHONE: case PED_FACE_PHONE:

View file

@ -22,6 +22,7 @@
#include "DummyObject.h" #include "DummyObject.h"
#include "Script.h" #include "Script.h"
#include "Shadows.h" #include "Shadows.h"
#include "SurfaceTable.h"
#define MIN_CREATION_DIST 40.0f // not for start of the game (look at the GeneratePedsAtStartOfGame) #define MIN_CREATION_DIST 40.0f // not for start of the game (look at the GeneratePedsAtStartOfGame)
#define CREATION_RANGE 10.0f // added over the MIN_CREATION_DIST. #define CREATION_RANGE 10.0f // added over the MIN_CREATION_DIST.
@ -1101,3 +1102,15 @@ CPopulation::AddDeadPedInFrontOfCar(const CVector& pos, CVehicle* pCulprit)
CVisibilityPlugins::SetClumpAlpha(pPed->GetClump(), 0); CVisibilityPlugins::SetClumpAlpha(pPed->GetClump(), 0);
return pPed; return pPed;
} }
bool
CPopulation::IsSkateable(CVector const& pos)
{
CColPoint foundCol;
CEntity* foundEnt = nil;
CWorld::ProcessVerticalLine(pos + CVector(0.f, 0.f, 2.f), pos.z - 2.0f, foundCol, foundEnt, true, false, false, false, false, false, nil);
if (!foundEnt)
return false;
return foundCol.surfaceB == SURFACE_TARMAC || foundCol.surfaceB == SURFACE_PAVEMENT;
}

View file

@ -89,6 +89,7 @@ public:
static void ConvertAllObjectsToDummyObjects(void); static void ConvertAllObjectsToDummyObjects(void);
static bool TestRoomForDummyObject(CObject*); static bool TestRoomForDummyObject(CObject*);
static bool TestSafeForRealObject(CDummyObject*); static bool TestSafeForRealObject(CDummyObject*);
static bool IsSkateable(CVector const&);
static CPed* AddDeadPedInFrontOfCar(const CVector& pos, CVehicle* pCulprit); static CPed* AddDeadPedInFrontOfCar(const CVector& pos, CVehicle* pCulprit);
}; };

View file

@ -1144,7 +1144,7 @@ void CHud::DrawAfterFade()
m_fHelpMessageTime = CMessages::GetWideStringLength(m_HelpMessage) * 0.05f + 3.0f; m_fHelpMessageTime = CMessages::GetWideStringLength(m_HelpMessage) * 0.05f + 3.0f;
if (TheCamera.m_ScreenReductionPercentage == 0.0f) if (TheCamera.m_ScreenReductionPercentage == 0.0f)
DMAudio.PlayFrontEndSound(SOUND_A0, 0); DMAudio.PlayFrontEndSound(SOUND_HUD_SOUND, 0);
break; break;
case 1: case 1:
case 2: case 2:

View file

@ -1447,8 +1447,7 @@ CAutomobile::ProcessControl(void)
gun.FireProjectile(this, &source, 0.0f); gun.FireProjectile(this, &source, 0.0f);
CStats::RoundsFiredByPlayer++; CStats::RoundsFiredByPlayer++;
//TODO(MIAMI): DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_SHOT_FIRED, 0.0f);
// DMAudio.PlayOneShot(m_audioEntityId, 55, 0.0f);
m_nGunFiringTime = CTimer::GetTimeInMilliseconds(); m_nGunFiringTime = CTimer::GetTimeInMilliseconds();
// Hunter gun // Hunter gun
}else if(CPad::GetPad(0)->GetHandBrake() && CTimer::GetTimeInMilliseconds() > m_nGunFiringTime+60){ }else if(CPad::GetPad(0)->GetHandBrake() && CTimer::GetTimeInMilliseconds() > m_nGunFiringTime+60){
@ -1458,8 +1457,7 @@ CAutomobile::ProcessControl(void)
gun.FireInstantHit(this, &source); gun.FireInstantHit(this, &source);
gun.AddGunshell(this, source, CVector2D(0.0f, 0.1f), 0.025f); gun.AddGunshell(this, source, CVector2D(0.0f, 0.1f), 0.025f);
CStats::RoundsFiredByPlayer++; CStats::RoundsFiredByPlayer++;
//TODO(MIAMI): DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_SHOT_FIRED, 0.0f);
// DMAudio.PlayOneShot(m_audioEntityId, 55, 0.0f);
m_nGunFiringTime = CTimer::GetTimeInMilliseconds(); m_nGunFiringTime = CTimer::GetTimeInMilliseconds();
} }
}else if(GetModelIndex() == MI_SEASPAR && GetStatus() == STATUS_PLAYER){ }else if(GetModelIndex() == MI_SEASPAR && GetStatus() == STATUS_PLAYER){
@ -1471,8 +1469,7 @@ CAutomobile::ProcessControl(void)
gun.FireInstantHit(this, &source); gun.FireInstantHit(this, &source);
gun.AddGunshell(this, source, CVector2D(0.0f, 0.1f), 0.025f); gun.AddGunshell(this, source, CVector2D(0.0f, 0.1f), 0.025f);
CStats::RoundsFiredByPlayer++; CStats::RoundsFiredByPlayer++;
//TODO(MIAMI): DMAudio.PlayOneShot(m_audioEntityId, SOUND_WEAPON_SHOT_FIRED, 0.0f);
// DMAudio.PlayOneShot(m_audioEntityId, 55, 0.0f);
m_nGunFiringTime = CTimer::GetTimeInMilliseconds(); m_nGunFiringTime = CTimer::GetTimeInMilliseconds();
} }
} }
@ -3032,7 +3029,7 @@ CAutomobile::ProcessControlInputs(uint8 pad)
if(!CPad::GetPad(pad)->GetExitVehicle() || if(!CPad::GetPad(pad)->GetExitVehicle() ||
pDriver && pDriver->m_pVehicleAnim && (pDriver->m_pVehicleAnim->animId == ANIM_CAR_ROLLOUT_LHS || pDriver && pDriver->m_pVehicleAnim && (pDriver->m_pVehicleAnim->animId == ANIM_CAR_ROLLOUT_LHS ||
pDriver->m_pVehicleAnim->animId == ANIM_CAR_ROLLOUT_LHS2)) pDriver->m_pVehicleAnim->animId == ANIM_CAR_ROLLOUT_RHS))
bIsHandbrakeOn = !!CPad::GetPad(pad)->GetHandBrake(); bIsHandbrakeOn = !!CPad::GetPad(pad)->GetHandBrake();
else else
bIsHandbrakeOn = true; bIsHandbrakeOn = true;
@ -4838,8 +4835,7 @@ CAutomobile::BurstTyre(uint8 wheel, bool applyForces)
if(status == WHEEL_STATUS_OK){ if(status == WHEEL_STATUS_OK){
Damage.SetWheelStatus(wheel, WHEEL_STATUS_BURST); Damage.SetWheelStatus(wheel, WHEEL_STATUS_BURST);
CStats::TyresPopped++; CStats::TyresPopped++;
// TODO(MIAMI) DMAudio.PlayOneShot(m_audioEntityId, SOUND_CAR_TYRE_POP, 0.0f);
// DMAudio.PlayOneShot(m_audioEntityId, SOUND_15, 0.0f);
if(GetStatus() == STATUS_SIMPLE){ if(GetStatus() == STATUS_SIMPLE){
SetStatus(STATUS_PHYSICS); SetStatus(STATUS_PHYSICS);
@ -5411,8 +5407,7 @@ CAutomobile::SetPanelDamage(int32 component, ePanels panel, bool noFlyingCompone
if(m_aCarNodes[component] == nil) if(m_aCarNodes[component] == nil)
return; return;
if(status == PANEL_STATUS_SMASHED1){ if(status == PANEL_STATUS_SMASHED1){
// TODO(MIAMI) DMAudio.PlayOneShot(m_audioEntityId, SOUND_CAR_WINDSHIELD_CRACK, 0.0f);
// DMAudio.PlayOneShot(m_audioEntityId, SOUND_12, 0.0f);
// show damaged part // show damaged part
SetComponentVisibility(m_aCarNodes[component], ATOMIC_FLAG_DAM); SetComponentVisibility(m_aCarNodes[component], ATOMIC_FLAG_DAM);
}else if(status == PANEL_STATUS_MISSING){ }else if(status == PANEL_STATUS_MISSING){

View file

@ -36,7 +36,7 @@ public:
CVector wheelieNormal; CVector wheelieNormal;
CVector wheelieRight; CVector wheelieRight;
tBikeHandlingData *pBikeHandling; tBikeHandlingData *pBikeHandling;
int32 m_bikeAnimType; AssocGroupId m_bikeAnimType;
uint8 m_wheelStatus[2]; uint8 m_wheelStatus[2];
CColPoint m_aWheelColPoints[4]; CColPoint m_aWheelColPoints[4];
float m_aSuspensionSpringRatio[4]; float m_aSuspensionSpringRatio[4];

View file

@ -204,7 +204,7 @@ CTrain::ProcessControl(void)
if(m_bTrainStopping){ if(m_bTrainStopping){
m_nDoorTimer = CTimer::GetTimeInMilliseconds() + 1000; m_nDoorTimer = CTimer::GetTimeInMilliseconds() + 1000;
m_nDoorState = TRAIN_DOOR_OPENING; m_nDoorState = TRAIN_DOOR_OPENING;
DMAudio.PlayOneShot(m_audioEntityId, SOUND_18, 0.0f); DMAudio.PlayOneShot(m_audioEntityId, SOUND_TRAIN_DOOR_CLOSE, 0.0f);
} }
break; break;
@ -221,7 +221,7 @@ CTrain::ProcessControl(void)
if(!m_bTrainStopping){ if(!m_bTrainStopping){
m_nDoorTimer = CTimer::GetTimeInMilliseconds() + 1000; m_nDoorTimer = CTimer::GetTimeInMilliseconds() + 1000;
m_nDoorState = TRAIN_DOOR_CLOSING; m_nDoorState = TRAIN_DOOR_CLOSING;
DMAudio.PlayOneShot(m_audioEntityId, SOUND_19, 0.0f); DMAudio.PlayOneShot(m_audioEntityId, SOUND_TRAIN_DOOR_OPEN, 0.0f);
} }
break; break;

View file

@ -824,9 +824,6 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
int32 accuracy = shooterPed->m_wepAccuracy; int32 accuracy = shooterPed->m_wepAccuracy;
int32 inaccuracy = 100-accuracy; int32 inaccuracy = 100-accuracy;
if ( accuracy != 100 )
FindPlayerPed(); //what ?
CPed *threatAttack = (CPed*)shooterPed->m_pPointGunAt; CPed *threatAttack = (CPed*)shooterPed->m_pPointGunAt;
if ( threatAttack->IsPed() ) if ( threatAttack->IsPed() )
{ {
@ -911,10 +908,19 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
} }
} }
if ( victim && shooter->IsPed() && victim == ((CPed*)shooter)->m_leader ) if (victim && shooter->IsPed())
return false; {
if (victim == ((CPed*)shooter)->m_leader)
return false;
CEventList::RegisterEvent(EVENT_GUNSHOT, EVENT_ENTITY_PED, shooter, (CPed *)shooter, 1000); if (victim->IsPed() && ((CPed*)shooter)->IsGangMember() && !((CPed*)victim)->CanBeDamagedByThisGangMember((CPed*)shooter))
return false;
}
if (shooter->IsPed())
CEventList::RegisterEvent(EVENT_GUNSHOT, EVENT_ENTITY_PED, shooter, (CPed*)shooter, 1000);
else if (shooter->IsVehicle() && ((CVehicle*)shooter)->pDriver)
CEventList::RegisterEvent(EVENT_GUNSHOT, EVENT_ENTITY_VEHICLE, shooter, ((CVehicle*)shooter)->pDriver, 1000);
if ( shooter == FindPlayerPed() ) if ( shooter == FindPlayerPed() )
{ {
@ -935,59 +941,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
if ( info->m_nFiringRate >= 50 && !(++counter & 1) ) if ( info->m_nFiringRate >= 50 && !(++counter & 1) )
{ {
CPointLights::AddLight(CPointLights::LIGHT_POINT, AddGunFlashBigGuns(*fireSource, *fireSource + target);
*fireSource, CVector(0.0f, 0.0f, 0.0f), 5.0f,
1.0f, 0.8f, 0.0f, CPointLights::FOG_NONE, false);
CVector gunflashPos = *fireSource;
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.08f);
gunflashPos += CVector(0.06f*ahead.x, 0.06f*ahead.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.06f);
gunflashPos += CVector(0.06f*ahead.x, 0.06f*ahead.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.06f);
gunflashPos = *fireSource;
gunflashPos += CVector(-0.1f*ahead.x, -0.1f*ahead.y, 0.0f);
gunflashPos.z += 0.04f;
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.04f);
gunflashPos.z += 0.04f;
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.02f);
gunflashPos.z += 0.03f;
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.02f);
gunflashPos = *fireSource;
gunflashPos += CVector(-0.1f*ahead.x, -0.1f*ahead.y, 0.0f);
gunflashPos.z -= 0.04f;
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.04f);
gunflashPos.z -= 0.04f;
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.02f);
gunflashPos.z -= 0.03f;
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.02f);
CVector offset = CrossProduct(CVector(ahead.x, ahead.y, 0.0f), CVector(0.0f, 0.0f, 5.0f));
offset.Normalise2D();
gunflashPos = *fireSource;
gunflashPos += CVector(-0.1f*ahead.x, -0.1f*ahead.y, 0.0f);
gunflashPos += CVector(0.06f*offset.x, 0.06f*offset.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.04f);
gunflashPos += CVector(0.04f*offset.x, 0.04f*offset.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.03f);
gunflashPos += CVector(0.03f*offset.x, 0.03f*offset.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.02f);
gunflashPos = *fireSource;
gunflashPos += CVector(-0.1f*ahead.x, -0.1f*ahead.y, 0.0f);
gunflashPos -= CVector(0.06f*offset.x, 0.06f*offset.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.04f);
gunflashPos -= CVector(0.04f*offset.x, 0.04f*offset.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.03f);
gunflashPos -= CVector(0.03f*offset.x, 0.03f*offset.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.02f);
CVector gunsmokePos = *fireSource;
float rnd = CGeneral::GetRandomNumberInRange(0.05f, 0.25f);
CParticle::AddParticle(PARTICLE_GUNSMOKE2, gunsmokePos, CVector(ahead.x*rnd, ahead.y*rnd, 0.0f));
CVector gunshellPos = *fireSource; CVector gunshellPos = *fireSource;
gunshellPos -= CVector(0.65f*ahead.x, 0.65f*ahead.y, 0.0f); gunshellPos -= CVector(0.65f*ahead.x, 0.65f*ahead.y, 0.0f);
@ -2761,6 +2715,71 @@ CWeapon::ProcessLineOfSight(CVector const &point1, CVector const &point2, CColPo
return CWorld::ProcessLineOfSight(point1, point2, point, entity, checkBuildings, checkVehicles, checkPeds, checkObjects, checkDummies, ignoreSeeThrough, ignoreSomeObjects); return CWorld::ProcessLineOfSight(point1, point2, point, entity, checkBuildings, checkVehicles, checkPeds, checkObjects, checkDummies, ignoreSeeThrough, ignoreSomeObjects);
} }
void
CWeapon::AddGunFlashBigGuns(CVector start, CVector end)
{
CPointLights::AddLight(CPointLights::LIGHT_POINT,
start, CVector(0.0f, 0.0f, 0.0f), 5.0f,
1.0f, 0.8f, 0.0f, CPointLights::FOG_NONE, false);
CVector gunflashPos = start;
CVector shootVec = end - start;
// Wtf did you do there R*?
shootVec.Normalise();
CVector2D ahead = shootVec;
ahead.Normalise();
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.08f);
gunflashPos += CVector(0.06f * ahead.x, 0.06f * ahead.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.06f);
gunflashPos += CVector(0.06f * ahead.x, 0.06f * ahead.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.06f);
gunflashPos = start;
gunflashPos += CVector(-0.1f * ahead.x, -0.1f * ahead.y, 0.0f);
gunflashPos.z += 0.04f;
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.04f);
gunflashPos.z += 0.04f;
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.02f);
gunflashPos.z += 0.03f;
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.02f);
gunflashPos = start;
gunflashPos += CVector(-0.1f * ahead.x, -0.1f * ahead.y, 0.0f);
gunflashPos.z -= 0.04f;
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.04f);
gunflashPos.z -= 0.04f;
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.02f);
gunflashPos.z -= 0.03f;
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.02f);
CVector offset = CrossProduct(CVector(ahead.x, ahead.y, 0.0f), CVector(0.0f, 0.0f, 5.0f));
offset.Normalise2D();
gunflashPos = start;
gunflashPos += CVector(-0.1f * ahead.x, -0.1f * ahead.y, 0.0f);
gunflashPos += CVector(0.06f * offset.x, 0.06f * offset.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.04f);
gunflashPos += CVector(0.04f * offset.x, 0.04f * offset.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.03f);
gunflashPos += CVector(0.03f * offset.x, 0.03f * offset.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.02f);
gunflashPos = start;
gunflashPos += CVector(-0.1f * ahead.x, -0.1f * ahead.y, 0.0f);
gunflashPos -= CVector(0.06f * offset.x, 0.06f * offset.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.04f);
gunflashPos -= CVector(0.04f * offset.x, 0.04f * offset.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.03f);
gunflashPos -= CVector(0.03f * offset.x, 0.03f * offset.y, 0.0f);
CParticle::AddParticle(PARTICLE_GUNFLASH_NOANIM, gunflashPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.02f);
CVector gunsmokePos = start;
float rnd = CGeneral::GetRandomNumberInRange(0.05f, 0.25f);
CParticle::AddParticle(PARTICLE_GUNSMOKE2, gunsmokePos, CVector(ahead.x * rnd, ahead.y * rnd, 0.0f));
}
#ifdef COMPATIBLE_SAVES #ifdef COMPATIBLE_SAVES
#define CopyFromBuf(buf, data) memcpy(&data, buf, sizeof(data)); SkipSaveBuf(buf, sizeof(data)); #define CopyFromBuf(buf, data) memcpy(&data, buf, sizeof(data)); SkipSaveBuf(buf, sizeof(data));
#define CopyToBuf(buf, data) memcpy(buf, &data, sizeof(data)); SkipSaveBuf(buf, sizeof(data)); #define CopyToBuf(buf, data) memcpy(buf, &data, sizeof(data)); SkipSaveBuf(buf, sizeof(data));

View file

@ -68,6 +68,7 @@ public:
bool HitsGround(CEntity *holder, CVector *fireSource, CEntity *aimingTo); bool HitsGround(CEntity *holder, CVector *fireSource, CEntity *aimingTo);
static void BlowUpExplosiveThings(CEntity *thing); static void BlowUpExplosiveThings(CEntity *thing);
bool HasWeaponAmmoToBeUsed(void); bool HasWeaponAmmoToBeUsed(void);
static void AddGunFlashBigGuns(CVector, CVector);
static bool IsShotgun(int weapon) { return weapon == WEAPONTYPE_SHOTGUN || weapon == WEAPONTYPE_SPAS12_SHOTGUN || weapon == WEAPONTYPE_STUBBY_SHOTGUN; } static bool IsShotgun(int weapon) { return weapon == WEAPONTYPE_SHOTGUN || weapon == WEAPONTYPE_SPAS12_SHOTGUN || weapon == WEAPONTYPE_STUBBY_SHOTGUN; }