Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
375c7df00f
@ -450,9 +450,9 @@ int8 cSampleManager::GetCurrent3DProviderIndex(void)
|
|||||||
|
|
||||||
int8 cSampleManager::SetCurrent3DProvider(uint8 nProvider)
|
int8 cSampleManager::SetCurrent3DProvider(uint8 nProvider)
|
||||||
{
|
{
|
||||||
ASSERT( nProvider < m_nNumberOfProviders );
|
|
||||||
if (nProvider >= m_nNumberOfProviders)
|
if (nProvider >= m_nNumberOfProviders)
|
||||||
nProvider = 0;
|
nProvider = 0;
|
||||||
|
ASSERT( nProvider < m_nNumberOfProviders );
|
||||||
int savedprovider = curprovider;
|
int savedprovider = curprovider;
|
||||||
|
|
||||||
if ( nProvider < m_nNumberOfProviders )
|
if ( nProvider < m_nNumberOfProviders )
|
||||||
|
@ -1682,7 +1682,7 @@ CPathFind::Load(uint8 *buf, uint32 size)
|
|||||||
void
|
void
|
||||||
CPathFind::DisplayPathData(void)
|
CPathFind::DisplayPathData(void)
|
||||||
{
|
{
|
||||||
// Not the function from mobm_carPathLinksile but my own!
|
// Not the function from mobile but my own!
|
||||||
|
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
// Draw 50 units around camera
|
// Draw 50 units around camera
|
||||||
|
@ -4994,7 +4994,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
|
|||||||
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
||||||
// Useless call
|
// Useless call
|
||||||
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
CRadar::GetActualBlipArrayIndex(CollectNextParameterWithoutIncreasingPC(m_nIp));
|
||||||
int handle = CRadar::SetCoordBlip(BLIP_COORD, pos, 2, BLIP_DISPLAY_BOTH);
|
int handle = CRadar::SetCoordBlip(BLIP_CONTACT_POINT, pos, 2, BLIP_DISPLAY_BOTH);
|
||||||
CRadar::ChangeBlipScale(handle, 3);
|
CRadar::ChangeBlipScale(handle, 3);
|
||||||
ScriptParams[0] = handle;
|
ScriptParams[0] = handle;
|
||||||
StoreParameters(&m_nIp, 1);
|
StoreParameters(&m_nIp, 1);
|
||||||
@ -9319,7 +9319,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
|
|||||||
CVector pos = *(CVector*)&ScriptParams[0];
|
CVector pos = *(CVector*)&ScriptParams[0];
|
||||||
if (pos.z <= MAP_Z_LOW_LIMIT)
|
if (pos.z <= MAP_Z_LOW_LIMIT)
|
||||||
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
pos.z = CWorld::FindGroundZForCoord(pos.x, pos.y);
|
||||||
C3dMarkers::PlaceMarkerSet((uintptr)this + m_nIp, 4, pos, *(float*)&ScriptParams[3],
|
C3dMarkers::PlaceMarkerSet((uintptr)this + m_nIp, MARKERTYPE_CYLINDER, pos, *(float*)&ScriptParams[3],
|
||||||
SPHERE_MARKER_R, SPHERE_MARKER_G, SPHERE_MARKER_B, SPHERE_MARKER_A,
|
SPHERE_MARKER_R, SPHERE_MARKER_G, SPHERE_MARKER_B, SPHERE_MARKER_A,
|
||||||
SPHERE_MARKER_PULSE_PERIOD, SPHERE_MARKER_PULSE_FRACTION, 0);
|
SPHERE_MARKER_PULSE_PERIOD, SPHERE_MARKER_PULSE_FRACTION, 0);
|
||||||
return 0;
|
return 0;
|
||||||
@ -11254,7 +11254,7 @@ void CTheScripts::DrawScriptSpheres()
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < MAX_NUM_SCRIPT_SPHERES; i++) {
|
for (int i = 0; i < MAX_NUM_SCRIPT_SPHERES; i++) {
|
||||||
if (ScriptSphereArray[i].m_bInUse)
|
if (ScriptSphereArray[i].m_bInUse)
|
||||||
C3dMarkers::PlaceMarkerSet(ScriptSphereArray[i].m_Id, 4, ScriptSphereArray[i].m_vecCenter, ScriptSphereArray[i].m_fRadius,
|
C3dMarkers::PlaceMarkerSet(ScriptSphereArray[i].m_Id, MARKERTYPE_CYLINDER, ScriptSphereArray[i].m_vecCenter, ScriptSphereArray[i].m_fRadius,
|
||||||
SPHERE_MARKER_R, SPHERE_MARKER_G, SPHERE_MARKER_B, SPHERE_MARKER_A, SPHERE_MARKER_PULSE_PERIOD, SPHERE_MARKER_PULSE_FRACTION, 0);
|
SPHERE_MARKER_R, SPHERE_MARKER_G, SPHERE_MARKER_B, SPHERE_MARKER_A, SPHERE_MARKER_PULSE_PERIOD, SPHERE_MARKER_PULSE_FRACTION, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1075,6 +1075,38 @@ CMenuManager::Draw()
|
|||||||
leftText = TheText.Get(aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName);
|
leftText = TheText.Get(aScreens[m_nCurrScreen].m_aEntries[i].m_EntryName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CUSTOM_FRONTEND_OPTIONS
|
||||||
|
if (aScreens[m_nCurrScreen].m_aEntries[i].m_SaveSlot == SAVESLOT_CFO) {
|
||||||
|
FrontendOption &option = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu];
|
||||||
|
if (option.type == FEOPTION_SELECT) {
|
||||||
|
if (option.onlyApplyOnEnter){
|
||||||
|
if (m_nCurrOption != i) {
|
||||||
|
if (option.displayedValue != option.lastSavedValue)
|
||||||
|
SetHelperText(3); // Restored original value
|
||||||
|
|
||||||
|
// option.displayedValue = option.lastSavedValue = *option.value;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (option.displayedValue != *option.value)
|
||||||
|
SetHelperText(1); // Enter to apply
|
||||||
|
else if (m_nHelperTextMsgId == 1)
|
||||||
|
ResetHelperText(); // Applied
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_nCurrOption != lastOption && lastOption == i) {
|
||||||
|
FrontendOption &oldOption = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[lastOption].m_TargetMenu];
|
||||||
|
if (oldOption.type == FEOPTION_DYNAMIC || oldOption.type == FEOPTION_BUILTIN_ACTION)
|
||||||
|
if(oldOption.buttonPressFunc)
|
||||||
|
oldOption.buttonPressFunc(FEOPTION_ACTION_FOCUSLOSS);
|
||||||
|
|
||||||
|
if (oldOption.onlyApplyOnEnter && oldOption.type == FEOPTION_SELECT)
|
||||||
|
oldOption.displayedValue = oldOption.lastSavedValue = *oldOption.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (aScreens[m_nCurrScreen].m_aEntries[i].m_Action) {
|
switch (aScreens[m_nCurrScreen].m_aEntries[i].m_Action) {
|
||||||
case MENUACTION_CHANGEMENU: {
|
case MENUACTION_CHANGEMENU: {
|
||||||
switch (aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu) {
|
switch (aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu) {
|
||||||
@ -1477,38 +1509,6 @@ CMenuManager::Draw()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CUSTOM_FRONTEND_OPTIONS
|
|
||||||
if (aScreens[m_nCurrScreen].m_aEntries[i].m_SaveSlot == SAVESLOT_CFO) {
|
|
||||||
FrontendOption &option = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[i].m_TargetMenu];
|
|
||||||
if (option.type == FEOPTION_SELECT) {
|
|
||||||
if (option.onlyApplyOnEnter){
|
|
||||||
if (m_nCurrOption != i) {
|
|
||||||
if (option.displayedValue != option.lastSavedValue)
|
|
||||||
SetHelperText(3); // Restored original value
|
|
||||||
|
|
||||||
// option.displayedValue = option.lastSavedValue = *option.value;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (option.displayedValue != *option.value)
|
|
||||||
SetHelperText(1); // Enter to apply
|
|
||||||
else if (m_nHelperTextMsgId == 1)
|
|
||||||
ResetHelperText(); // Applied
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_nCurrOption != lastOption && lastOption == i) {
|
|
||||||
FrontendOption &oldOption = customFrontendOptions[aScreens[m_nCurrScreen].m_aEntries[lastOption].m_TargetMenu];
|
|
||||||
if (oldOption.type == FEOPTION_DYNAMIC || oldOption.type == FEOPTION_BUILTIN_ACTION)
|
|
||||||
if(oldOption.buttonPressFunc)
|
|
||||||
oldOption.buttonPressFunc(FEOPTION_ACTION_FOCUSLOSS);
|
|
||||||
|
|
||||||
if (oldOption.onlyApplyOnEnter && oldOption.type == FEOPTION_SELECT)
|
|
||||||
oldOption.displayedValue = oldOption.lastSavedValue = *oldOption.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Sliders
|
// Sliders
|
||||||
int lastActiveBarX;
|
int lastActiveBarX;
|
||||||
switch (aScreens[m_nCurrScreen].m_aEntries[i].m_Action) {
|
switch (aScreens[m_nCurrScreen].m_aEntries[i].m_Action) {
|
||||||
|
@ -295,7 +295,10 @@ bool CGame::InitialiseOnceAfterRW(void)
|
|||||||
CWorld::Players[0].SetPlayerSkin(CMenuManager::m_PrefsSkinFile);
|
CWorld::Players[0].SetPlayerSkin(CMenuManager::m_PrefsSkinFile);
|
||||||
|
|
||||||
#ifdef CUSTOM_FRONTEND_OPTIONS
|
#ifdef CUSTOM_FRONTEND_OPTIONS
|
||||||
|
if (numCustomFrontendOptions == 0 && numCustomFrontendScreens == 0) {
|
||||||
CustomFrontendOptionsPopulate();
|
CustomFrontendOptionsPopulate();
|
||||||
|
FrontEndMenuManager.LoadSettings();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,12 @@ wchar* MultiSamplingDraw(bool *disabled, bool userHovering) {
|
|||||||
} else {
|
} else {
|
||||||
FrontEndMenuManager.SetHelperText(1);
|
FrontEndMenuManager.SetHelperText(1);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (FrontEndMenuManager.m_nDisplayMSAALevel != FrontEndMenuManager.m_nPrefsMSAALevel) {
|
||||||
|
FrontEndMenuManager.m_nDisplayMSAALevel = FrontEndMenuManager.m_nPrefsMSAALevel;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!FrontEndMenuManager.m_bGameNotLoaded)
|
if (!FrontEndMenuManager.m_bGameNotLoaded)
|
||||||
*disabled = true;
|
*disabled = true;
|
||||||
|
|
||||||
@ -305,7 +310,7 @@ CustomFrontendOptionsPopulate(void)
|
|||||||
#endif
|
#endif
|
||||||
// -- Graphics/display seperation preperation end
|
// -- Graphics/display seperation preperation end
|
||||||
|
|
||||||
static const wchar* off_on[] = { TheText.Get("FEM_OFF"), TheText.Get("FEM_ON") };
|
const wchar* off_on[] = { TheText.Get("FEM_OFF"), TheText.Get("FEM_ON") };
|
||||||
|
|
||||||
#ifdef MORE_LANGUAGES
|
#ifdef MORE_LANGUAGES
|
||||||
FrontendOptionSetCursor(MENUPAGE_LANGUAGE_SETTINGS, -2);
|
FrontendOptionSetCursor(MENUPAGE_LANGUAGE_SETTINGS, -2);
|
||||||
@ -326,7 +331,7 @@ CustomFrontendOptionsPopulate(void)
|
|||||||
CLONE_OPTION(TheText.Get("FED_WIS"), MENUACTION_WIDESCREEN, nil, nil)
|
CLONE_OPTION(TheText.Get("FED_WIS"), MENUACTION_WIDESCREEN, nil, nil)
|
||||||
|
|
||||||
#ifdef IMPROVED_VIDEOMODE
|
#ifdef IMPROVED_VIDEOMODE
|
||||||
static const wchar* screenModes[] = { (wchar*)L"FULLSCREEN", (wchar*)L"WINDOWED" };
|
const wchar* screenModes[] = { TheText.Get("FED_FLS"), TheText.Get("FED_WND") };
|
||||||
// Storing isn't enabled because it's handled in Frontend
|
// Storing isn't enabled because it's handled in Frontend
|
||||||
FrontendOptionAddSelect(TheText.Get("FEM_SCF"), screenModes, 2, (int8*)&FrontEndMenuManager.m_nPrefsWindowed, true, ScreenModeChange, nil);
|
FrontendOptionAddSelect(TheText.Get("FEM_SCF"), screenModes, 2, (int8*)&FrontEndMenuManager.m_nPrefsWindowed, true, ScreenModeChange, nil);
|
||||||
#endif
|
#endif
|
||||||
|
@ -76,6 +76,10 @@ RemoveCustomFrontendOptions()
|
|||||||
for (int j = 0; j < NUM_MENUROWS; j++) {
|
for (int j = 0; j < NUM_MENUROWS; j++) {
|
||||||
if (aScreens[i].m_aEntries[j].m_SaveSlot == SAVESLOT_CFO) {
|
if (aScreens[i].m_aEntries[j].m_SaveSlot == SAVESLOT_CFO) {
|
||||||
int ogOptionId = customFrontendOptions[aScreens[i].m_aEntries[j].m_TargetMenu].ogOptionId;
|
int ogOptionId = customFrontendOptions[aScreens[i].m_aEntries[j].m_TargetMenu].ogOptionId;
|
||||||
|
|
||||||
|
if (customFrontendOptions[aScreens[i].m_aEntries[j].m_TargetMenu].type == FEOPTION_SELECT)
|
||||||
|
free(customFrontendOptions[aScreens[i].m_aEntries[j].m_TargetMenu].rightTexts);
|
||||||
|
|
||||||
if (ogOptionId == -1) {
|
if (ogOptionId == -1) {
|
||||||
int k;
|
int k;
|
||||||
for (k = j; k < NUM_MENUROWS - 1; k++) {
|
for (k = j; k < NUM_MENUROWS - 1; k++) {
|
||||||
@ -219,7 +223,8 @@ void FrontendOptionAddSelect(const wchar* leftText, const wchar** rightTexts, in
|
|||||||
FrontendOption& option = customFrontendOptions[numCustomFrontendOptions - 1];
|
FrontendOption& option = customFrontendOptions[numCustomFrontendOptions - 1];
|
||||||
option.type = FEOPTION_SELECT;
|
option.type = FEOPTION_SELECT;
|
||||||
TextCopy(option.leftText, leftText);
|
TextCopy(option.leftText, leftText);
|
||||||
option.rightTexts = rightTexts;
|
option.rightTexts = (wchar**)malloc(numRightTexts * sizeof(wchar*));
|
||||||
|
memcpy(option.rightTexts, rightTexts, numRightTexts * sizeof(wchar*));
|
||||||
option.numRightTexts = numRightTexts;
|
option.numRightTexts = numRightTexts;
|
||||||
option.value = var;
|
option.value = var;
|
||||||
option.displayedValue = *var;
|
option.displayedValue = *var;
|
||||||
|
@ -107,7 +107,7 @@ struct FrontendOption
|
|||||||
|
|
||||||
// Only for static/select
|
// Only for static/select
|
||||||
struct {
|
struct {
|
||||||
const wchar** rightTexts;
|
wchar** rightTexts;
|
||||||
int8 numRightTexts;
|
int8 numRightTexts;
|
||||||
bool onlyApplyOnEnter;
|
bool onlyApplyOnEnter;
|
||||||
ChangeFunc changeFunc;
|
ChangeFunc changeFunc;
|
||||||
|
@ -202,8 +202,8 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
|
|||||||
m_pedFormation = FORMATION_UNDEFINED;
|
m_pedFormation = FORMATION_UNDEFINED;
|
||||||
m_collidingThingTimer = 0;
|
m_collidingThingTimer = 0;
|
||||||
m_nPedStateTimer = 0;
|
m_nPedStateTimer = 0;
|
||||||
m_actionX = 0;
|
m_actionX = 0.0f;
|
||||||
m_actionY = 0;
|
m_actionY = 0.0f;
|
||||||
m_phoneTalkTimer = 0;
|
m_phoneTalkTimer = 0;
|
||||||
m_stateUnused = 0;
|
m_stateUnused = 0;
|
||||||
m_leaveCarTimer = 0;
|
m_leaveCarTimer = 0;
|
||||||
@ -295,7 +295,6 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
|
|||||||
bIsShooting = false;
|
bIsShooting = false;
|
||||||
bFindNewNodeAfterStateRestore = false;
|
bFindNewNodeAfterStateRestore = false;
|
||||||
|
|
||||||
bHasACamera = false;
|
|
||||||
bGonnaInvestigateEvent = false;
|
bGonnaInvestigateEvent = false;
|
||||||
bPedIsBleeding = false;
|
bPedIsBleeding = false;
|
||||||
bStopAndShoot = false;
|
bStopAndShoot = false;
|
||||||
@ -352,7 +351,9 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
|
|||||||
bSomeVCflag1 = false;
|
bSomeVCflag1 = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((CGeneral::GetRandomNumber() & 3) == 0)
|
if (CGeneral::GetRandomNumber() & 3)
|
||||||
|
bHasACamera = false;
|
||||||
|
else
|
||||||
bHasACamera = true;
|
bHasACamera = true;
|
||||||
|
|
||||||
m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, this);
|
m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, this);
|
||||||
@ -766,10 +767,10 @@ CPed::OurPedCanSeeThisOne(CEntity *target)
|
|||||||
CColPoint colpoint;
|
CColPoint colpoint;
|
||||||
CEntity *ent;
|
CEntity *ent;
|
||||||
|
|
||||||
CVector2D dist = CVector2D(target->GetPosition()) - CVector2D(this->GetPosition());
|
CVector2D dist = CVector2D(target->GetPosition()) - CVector2D(GetPosition());
|
||||||
|
|
||||||
// Check if target is behind ped
|
// Check if target is behind ped
|
||||||
if (DotProduct2D(dist, CVector2D(this->GetForward())) < 0.0f)
|
if (DotProduct2D(dist, CVector2D(GetForward())) < 0.0f)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Check if target is too far away
|
// Check if target is too far away
|
||||||
@ -798,7 +799,7 @@ CPed::Avoid(void)
|
|||||||
if (nearestPed && nearestPed->m_nPedState != PED_DEAD && nearestPed != m_pSeekTarget && nearestPed != m_pedInObjective) {
|
if (nearestPed && nearestPed->m_nPedState != PED_DEAD && nearestPed != m_pSeekTarget && nearestPed != m_pedInObjective) {
|
||||||
|
|
||||||
// Check if this ped wants to avoid the nearest one
|
// Check if this ped wants to avoid the nearest one
|
||||||
if (CPedType::GetAvoid(this->m_nPedType) & CPedType::GetFlag(nearestPed->m_nPedType)) {
|
if (CPedType::GetAvoid(m_nPedType) & CPedType::GetFlag(nearestPed->m_nPedType)) {
|
||||||
|
|
||||||
// Further codes checks whether the distance between us and ped will be equal or below 1.0, if we walk up to him by 1.25 meters.
|
// Further codes checks whether the distance between us and ped will be equal or below 1.0, if we walk up to him by 1.25 meters.
|
||||||
// If so, we want to avoid it, so we turn our body 45 degree and look to somewhere else.
|
// If so, we want to avoid it, so we turn our body 45 degree and look to somewhere else.
|
||||||
@ -1761,7 +1762,6 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase)
|
|||||||
|
|
||||||
if (seatPosMult > 0.2f || vehIsUpsideDown) {
|
if (seatPosMult > 0.2f || vehIsUpsideDown) {
|
||||||
SetPosition(neededPos);
|
SetPosition(neededPos);
|
||||||
|
|
||||||
SetHeading(m_fRotationCur);
|
SetHeading(m_fRotationCur);
|
||||||
} else {
|
} else {
|
||||||
CMatrix vehDoorMat(veh->GetMatrix());
|
CMatrix vehDoorMat(veh->GetMatrix());
|
||||||
@ -2925,7 +2925,7 @@ CPed::ReactToAttack(CEntity *attacker)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (bCrouchWhenShooting || bKindaStayInSamePlace) {
|
} else if (bCrouchWhenShooting || bKindaStayInSamePlace) {
|
||||||
SetDuck(CGeneral::GetRandomNumberInRange(1000,3000));
|
SetDuck(CGeneral::GetRandomNumberInRange(1000, 3000));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8130,7 +8130,7 @@ CPed::InvestigateEvent(void)
|
|||||||
animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_STANCE);
|
animAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_IDLE_STANCE);
|
||||||
|
|
||||||
if (animAssoc && animAssoc->animId == ANIM_IDLE_CAM) {
|
if (animAssoc && animAssoc->animId == ANIM_IDLE_CAM) {
|
||||||
CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 14.0f);
|
CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 4.0f);
|
||||||
SetLookTimer(CGeneral::GetRandomNumberInRange(1000, 2500));
|
SetLookTimer(CGeneral::GetRandomNumberInRange(1000, 2500));
|
||||||
|
|
||||||
} else if (CGeneral::GetRandomNumber() & 3) {
|
} else if (CGeneral::GetRandomNumber() & 3) {
|
||||||
@ -8157,7 +8157,7 @@ CPed::InvestigateEvent(void)
|
|||||||
animToPlay = ANIM_XPRESS_SCRATCH;
|
animToPlay = ANIM_XPRESS_SCRATCH;
|
||||||
|
|
||||||
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, animToPlay, 4.0f);
|
CAnimManager::BlendAnimation(GetClump(), ASSOCGRP_STD, animToPlay, 4.0f);
|
||||||
SetLookTimer(CGeneral::GetRandomNumberInRange(1000, 2500));
|
SetLookTimer(CGeneral::GetRandomNumberInRange(1500, 4000));
|
||||||
|
|
||||||
} else if (animAssoc && animAssoc->animId == ANIM_IDLE_HBHB) {
|
} else if (animAssoc && animAssoc->animId == ANIM_IDLE_HBHB) {
|
||||||
animAssoc->blendDelta = -8.0f;
|
animAssoc->blendDelta = -8.0f;
|
||||||
@ -8247,7 +8247,7 @@ CPed::InvestigateEvent(void)
|
|||||||
SetMoveState(PEDMOVE_WALK);
|
SetMoveState(PEDMOVE_WALK);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (distSqr > 1.44f) {
|
if (distSqr > sq(1.2f)) {
|
||||||
SetMoveState(PEDMOVE_WALK);
|
SetMoveState(PEDMOVE_WALK);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -8555,7 +8555,6 @@ CPed::LookForInterestingNodes(void)
|
|||||||
{
|
{
|
||||||
CBaseModelInfo *model;
|
CBaseModelInfo *model;
|
||||||
CPtrNode *ptrNode;
|
CPtrNode *ptrNode;
|
||||||
CVector effectPos;
|
|
||||||
CVector effectDist;
|
CVector effectDist;
|
||||||
C2dEffect *effect;
|
C2dEffect *effect;
|
||||||
CMatrix *objMat;
|
CMatrix *objMat;
|
||||||
@ -8596,7 +8595,7 @@ CPed::LookForInterestingNodes(void)
|
|||||||
effect = model->Get2dEffect(e);
|
effect = model->Get2dEffect(e);
|
||||||
if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) {
|
if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) {
|
||||||
objMat = &veh->GetMatrix();
|
objMat = &veh->GetMatrix();
|
||||||
effectPos = veh->GetMatrix() * effect->pos;
|
CVector effectPos = veh->GetMatrix() * effect->pos;
|
||||||
effectDist = effectPos - GetPosition();
|
effectDist = effectPos - GetPosition();
|
||||||
if (effectDist.MagnitudeSqr() < sq(8.0f)) {
|
if (effectDist.MagnitudeSqr() < sq(8.0f)) {
|
||||||
found = true;
|
found = true;
|
||||||
@ -8614,7 +8613,7 @@ CPed::LookForInterestingNodes(void)
|
|||||||
effect = model->Get2dEffect(e);
|
effect = model->Get2dEffect(e);
|
||||||
if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) {
|
if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) {
|
||||||
objMat = &obj->GetMatrix();
|
objMat = &obj->GetMatrix();
|
||||||
effectPos = obj->GetMatrix() * effect->pos;
|
CVector effectPos = obj->GetMatrix() * effect->pos;
|
||||||
effectDist = effectPos - GetPosition();
|
effectDist = effectPos - GetPosition();
|
||||||
if (effectDist.MagnitudeSqr() < sq(8.0f)) {
|
if (effectDist.MagnitudeSqr() < sq(8.0f)) {
|
||||||
found = true;
|
found = true;
|
||||||
@ -8632,7 +8631,7 @@ CPed::LookForInterestingNodes(void)
|
|||||||
effect = model->Get2dEffect(e);
|
effect = model->Get2dEffect(e);
|
||||||
if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) {
|
if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) {
|
||||||
objMat = &building->GetMatrix();
|
objMat = &building->GetMatrix();
|
||||||
effectPos = building->GetMatrix() * effect->pos;
|
CVector effectPos = building->GetMatrix() * effect->pos;
|
||||||
effectDist = effectPos - GetPosition();
|
effectDist = effectPos - GetPosition();
|
||||||
if (effectDist.MagnitudeSqr() < sq(8.0f)) {
|
if (effectDist.MagnitudeSqr() < sq(8.0f)) {
|
||||||
found = true;
|
found = true;
|
||||||
@ -8650,7 +8649,7 @@ CPed::LookForInterestingNodes(void)
|
|||||||
effect = model->Get2dEffect(e);
|
effect = model->Get2dEffect(e);
|
||||||
if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) {
|
if (effect->type == EFFECT_ATTRACTOR && effect->attractor.probability >= randVal) {
|
||||||
objMat = &building->GetMatrix();
|
objMat = &building->GetMatrix();
|
||||||
effectPos = building->GetMatrix() * effect->pos;
|
CVector effectPos = building->GetMatrix() * effect->pos;
|
||||||
effectDist = effectPos - GetPosition();
|
effectDist = effectPos - GetPosition();
|
||||||
if (effectDist.MagnitudeSqr() < sq(8.0f)) {
|
if (effectDist.MagnitudeSqr() < sq(8.0f)) {
|
||||||
found = true;
|
found = true;
|
||||||
@ -8676,12 +8675,13 @@ CPed::LookForInterestingNodes(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CVector2D effectPos = *objMat * effect->pos;
|
||||||
switch (effect->attractor.type) {
|
switch (effect->attractor.type) {
|
||||||
case ATTRACTORTYPE_ICECREAM:
|
case ATTRACTORTYPE_ICECREAM:
|
||||||
SetInvestigateEvent(EVENT_ICECREAM, CVector2D(effectPos), 0.1f, 15000, angleToFace);
|
SetInvestigateEvent(EVENT_ICECREAM, effectPos, 0.1f, 15000, angleToFace);
|
||||||
break;
|
break;
|
||||||
case ATTRACTORTYPE_STARE:
|
case ATTRACTORTYPE_STARE:
|
||||||
SetInvestigateEvent(EVENT_SHOPSTALL, CVector2D(effectPos), 1.0f,
|
SetInvestigateEvent(EVENT_SHOPSTALL, effectPos, 1.0f,
|
||||||
CGeneral::GetRandomNumberInRange(8000, 10 * effect->attractor.probability + 8500),
|
CGeneral::GetRandomNumberInRange(8000, 10 * effect->attractor.probability + 8500),
|
||||||
angleToFace);
|
angleToFace);
|
||||||
break;
|
break;
|
||||||
@ -11732,7 +11732,7 @@ CPed::RegisterThreatWithGangPeds(CEntity *attacker)
|
|||||||
if (!attackerPed->m_pMyVehicle || attackerPed->m_pMyVehicle->GetModelIndex() != MI_TOYZ) {
|
if (!attackerPed->m_pMyVehicle || attackerPed->m_pMyVehicle->GetModelIndex() != MI_TOYZ) {
|
||||||
int16 lastVehicle;
|
int16 lastVehicle;
|
||||||
CEntity *vehicles[8];
|
CEntity *vehicles[8];
|
||||||
CWorld::FindObjectsInRange(GetPosition(), 30.0f, true, &lastVehicle, 6, vehicles, false, true, false, false, false);
|
CWorld::FindObjectsInRange(GetPosition(), ENTER_CAR_MAX_DIST, true, &lastVehicle, 6, vehicles, false, true, false, false, false);
|
||||||
|
|
||||||
if (lastVehicle > 8)
|
if (lastVehicle > 8)
|
||||||
lastVehicle = 8;
|
lastVehicle = 8;
|
||||||
@ -12539,7 +12539,8 @@ CPed::ProcessObjective(void)
|
|||||||
SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
|
SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
|
||||||
bFleeAfterExitingCar = true;
|
bFleeAfterExitingCar = true;
|
||||||
} else if (m_nPedState != PED_FLEE_POS) {
|
} else if (m_nPedState != PED_FLEE_POS) {
|
||||||
SetFlee(GetPosition(), 10000);
|
CVector2D fleePos = GetPosition();
|
||||||
|
SetFlee(fleePos, 10000);
|
||||||
bUsePedNodeSeek = true;
|
bUsePedNodeSeek = true;
|
||||||
m_pNextPathNode = nil;
|
m_pNextPathNode = nil;
|
||||||
}
|
}
|
||||||
@ -12585,7 +12586,7 @@ CPed::ProcessObjective(void)
|
|||||||
{
|
{
|
||||||
if (m_pedInObjective) {
|
if (m_pedInObjective) {
|
||||||
if (m_pedInObjective->IsPlayer() && CharCreatedBy != MISSION_CHAR
|
if (m_pedInObjective->IsPlayer() && CharCreatedBy != MISSION_CHAR
|
||||||
&& m_nPedType != PEDTYPE_COP && FindPlayerPed()->m_pWanted->m_CurrentCops
|
&& m_nPedType != PEDTYPE_COP && FindPlayerPed()->m_pWanted->m_CurrentCops != 0
|
||||||
&& !bKindaStayInSamePlace) {
|
&& !bKindaStayInSamePlace) {
|
||||||
|
|
||||||
SetObjective(OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE);
|
SetObjective(OBJECTIVE_FLEE_ON_FOOT_TILL_SAFE);
|
||||||
@ -12693,7 +12694,6 @@ CPed::ProcessObjective(void)
|
|||||||
SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
|
SetObjective(OBJECTIVE_LEAVE_CAR, m_pMyVehicle);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_pedInObjective || m_pedInObjective->DyingOrDead()) {
|
if (!m_pedInObjective || m_pedInObjective->DyingOrDead()) {
|
||||||
ClearLookFlag();
|
ClearLookFlag();
|
||||||
bObjectiveCompleted = true;
|
bObjectiveCompleted = true;
|
||||||
@ -13249,7 +13249,7 @@ CPed::ProcessObjective(void)
|
|||||||
if (m_carInObjective && m_carInObjective->m_fHealth > 0.0f) {
|
if (m_carInObjective && m_carInObjective->m_fHealth > 0.0f) {
|
||||||
distWithTarget = m_carInObjective->GetPosition() - GetPosition();
|
distWithTarget = m_carInObjective->GetPosition() - GetPosition();
|
||||||
if (!bInVehicle) {
|
if (!bInVehicle) {
|
||||||
if (nEnterCarRangeMultiplier * 30.0f < distWithTarget.Magnitude()) {
|
if (nEnterCarRangeMultiplier * ENTER_CAR_MAX_DIST < distWithTarget.Magnitude()) {
|
||||||
if (!m_carInObjective->pDriver && !m_carInObjective->GetIsOnScreen() && !GetIsOnScreen())
|
if (!m_carInObjective->pDriver && !m_carInObjective->GetIsOnScreen() && !GetIsOnScreen())
|
||||||
WarpPedToNearEntityOffScreen(m_carInObjective);
|
WarpPedToNearEntityOffScreen(m_carInObjective);
|
||||||
|
|
||||||
@ -13534,11 +13534,12 @@ CPed::ProcessObjective(void)
|
|||||||
RestorePreviousObjective();
|
RestorePreviousObjective();
|
||||||
} else if (m_hitRecoverTimer < CTimer::GetTimeInMilliseconds()) {
|
} else if (m_hitRecoverTimer < CTimer::GetTimeInMilliseconds()) {
|
||||||
CVehicle *carToSteal = nil;
|
CVehicle *carToSteal = nil;
|
||||||
float closestCarDist = 30.0f;
|
float closestCarDist = ENTER_CAR_MAX_DIST;
|
||||||
CVector pos = GetPosition();
|
CVector pos = GetPosition();
|
||||||
int16 lastVehicle;
|
int16 lastVehicle;
|
||||||
CEntity *vehicles[8];
|
CEntity *vehicles[8];
|
||||||
|
|
||||||
|
// NB: This should've been ENTER_CAR_MAX_DIST actually, and is fixed in VC.
|
||||||
CWorld::FindObjectsInRange(pos, CHECK_NEARBY_THINGS_MAX_DIST, true, &lastVehicle, 6, vehicles, false, true, false, false, false);
|
CWorld::FindObjectsInRange(pos, CHECK_NEARBY_THINGS_MAX_DIST, true, &lastVehicle, 6, vehicles, false, true, false, false, false);
|
||||||
for(int i = 0; i < lastVehicle; i++) {
|
for(int i = 0; i < lastVehicle; i++) {
|
||||||
CVehicle *nearVeh = (CVehicle*)vehicles[i];
|
CVehicle *nearVeh = (CVehicle*)vehicles[i];
|
||||||
@ -14545,14 +14546,10 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
|
|||||||
upperSpeedLimit *= 2.0f;
|
upperSpeedLimit *= 2.0f;
|
||||||
lowerSpeedLimit *= 1.5f;
|
lowerSpeedLimit *= 1.5f;
|
||||||
}
|
}
|
||||||
if (!bWasStanding) {
|
CAnimBlendAssociation *fallAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FALL_FALL);
|
||||||
if ((speed <= upperSpeedLimit /* || (bfFlagsL >> 5) & 1 */) && m_vecMoveSpeed.z >= lowerSpeedLimit
|
if (!bWasStanding && speed > upperSpeedLimit && (/*!bPushedAlongByCar ||*/ m_vecMoveSpeed.z < lowerSpeedLimit)
|
||||||
|| m_pCollidingEntity == collidingEnt) {
|
&& m_pCollidingEntity != collidingEnt) {
|
||||||
|
|
||||||
if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FALL_FALL) && -0.016f * CTimer::GetTimeStep() > m_vecMoveSpeed.z) {
|
|
||||||
InflictDamage(collidingEnt, WEAPONTYPE_FALL, 15.0f, PEDPIECE_TORSO, 2);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
float damage = 100.0f * Max(speed - 0.25f, 0.0f);
|
float damage = 100.0f * Max(speed - 0.25f, 0.0f);
|
||||||
float damage2 = damage;
|
float damage2 = damage;
|
||||||
if (m_vecMoveSpeed.z < -0.25f)
|
if (m_vecMoveSpeed.z < -0.25f)
|
||||||
@ -14563,20 +14560,18 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
|
|||||||
CVector2D offset = -m_vecMoveSpeed;
|
CVector2D offset = -m_vecMoveSpeed;
|
||||||
dir = GetLocalDirection(offset);
|
dir = GetLocalDirection(offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
InflictDamage(collidingEnt, WEAPONTYPE_FALL, damage, PEDPIECE_TORSO, dir);
|
InflictDamage(collidingEnt, WEAPONTYPE_FALL, damage, PEDPIECE_TORSO, dir);
|
||||||
if (IsPlayer() && damage2 > 5.0f)
|
if (IsPlayer() && damage2 > 5.0f)
|
||||||
Say(SOUND_PED_LAND);
|
Say(SOUND_PED_LAND);
|
||||||
}
|
|
||||||
|
} else if (!bWasStanding && fallAnim && -0.016f * CTimer::GetTimeStep() > m_vecMoveSpeed.z) {
|
||||||
|
InflictDamage(collidingEnt, WEAPONTYPE_FALL, 15.0f, PEDPIECE_TORSO, 2);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
float speedSqr = 0.0f;
|
float speedSqr = 0.0f;
|
||||||
if (!bWasStanding) {
|
CAnimBlendAssociation *fallAnim = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FALL_FALL);
|
||||||
if (m_vecMoveSpeed.z >= -0.25f && (speedSqr = m_vecMoveSpeed.MagnitudeSqr()) <= sq(0.5f)) {
|
if (!bWasStanding && (m_vecMoveSpeed.z < -0.25f || (speedSqr = m_vecMoveSpeed.MagnitudeSqr()) > sq(0.5f))) {
|
||||||
|
|
||||||
if (RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FALL_FALL) && -0.016f * CTimer::GetTimeStep() > m_vecMoveSpeed.z) {
|
|
||||||
InflictDamage(collidingEnt, WEAPONTYPE_FALL, 15.0f, PEDPIECE_TORSO, 2);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (speedSqr == 0.0f)
|
if (speedSqr == 0.0f)
|
||||||
speedSqr = sq(m_vecMoveSpeed.z);
|
speedSqr = sq(m_vecMoveSpeed.z);
|
||||||
|
|
||||||
@ -14586,7 +14581,9 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
|
|||||||
dir = GetLocalDirection(offset);
|
dir = GetLocalDirection(offset);
|
||||||
}
|
}
|
||||||
InflictDamage(collidingEnt, WEAPONTYPE_FALL, 350.0f * sq(speedSqr), PEDPIECE_TORSO, dir);
|
InflictDamage(collidingEnt, WEAPONTYPE_FALL, 350.0f * sq(speedSqr), PEDPIECE_TORSO, dir);
|
||||||
}
|
|
||||||
|
} else if (!bWasStanding && fallAnim && -0.016f * CTimer::GetTimeStep() > m_vecMoveSpeed.z) {
|
||||||
|
InflictDamage(collidingEnt, WEAPONTYPE_FALL, 15.0f, PEDPIECE_TORSO, 2);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
m_vecMoveSpeed.z = 0.0f;
|
m_vecMoveSpeed.z = 0.0f;
|
||||||
@ -15008,7 +15005,7 @@ CPed::ProcessBuoyancy(void)
|
|||||||
ApplyMoveForce(buoyancyImpulse);
|
ApplyMoveForce(buoyancyImpulse);
|
||||||
if (!DyingOrDead()) {
|
if (!DyingOrDead()) {
|
||||||
if (bTryingToReachDryLand) {
|
if (bTryingToReachDryLand) {
|
||||||
if (buoyancyImpulse.z / m_fMass > 0.0032f * CTimer::GetTimeStep()) {
|
if (buoyancyImpulse.z / m_fMass > GRAVITY * 0.4f * CTimer::GetTimeStep()) {
|
||||||
bTryingToReachDryLand = false;
|
bTryingToReachDryLand = false;
|
||||||
CVector pos = GetPosition();
|
CVector pos = GetPosition();
|
||||||
if (PlacePedOnDryLand()) {
|
if (PlacePedOnDryLand()) {
|
||||||
@ -15032,7 +15029,7 @@ CPed::ProcessBuoyancy(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
float speedMult = 0.0f;
|
float speedMult = 0.0f;
|
||||||
if (buoyancyImpulse.z / m_fMass > 0.006f * CTimer::GetTimeStep()
|
if (buoyancyImpulse.z / m_fMass > GRAVITY * 0.75f * CTimer::GetTimeStep()
|
||||||
|| mod_Buoyancy.m_waterlevel > GetPosition().z) {
|
|| mod_Buoyancy.m_waterlevel > GetPosition().z) {
|
||||||
speedMult = pow(0.9f, CTimer::GetTimeStep());
|
speedMult = pow(0.9f, CTimer::GetTimeStep());
|
||||||
m_vecMoveSpeed.x *= speedMult;
|
m_vecMoveSpeed.x *= speedMult;
|
||||||
@ -15041,7 +15038,7 @@ CPed::ProcessBuoyancy(void)
|
|||||||
bIsStanding = false;
|
bIsStanding = false;
|
||||||
InflictDamage(nil, WEAPONTYPE_DROWNING, 3.0f * CTimer::GetTimeStep(), PEDPIECE_TORSO, 0);
|
InflictDamage(nil, WEAPONTYPE_DROWNING, 3.0f * CTimer::GetTimeStep(), PEDPIECE_TORSO, 0);
|
||||||
}
|
}
|
||||||
if (buoyancyImpulse.z / m_fMass > 0.002f * CTimer::GetTimeStep()) {
|
if (buoyancyImpulse.z / m_fMass > GRAVITY * 0.25f * CTimer::GetTimeStep()) {
|
||||||
if (speedMult == 0.0f) {
|
if (speedMult == 0.0f) {
|
||||||
speedMult = pow(0.9f, CTimer::GetTimeStep());
|
speedMult = pow(0.9f, CTimer::GetTimeStep());
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#define FEET_OFFSET 1.04f
|
#define FEET_OFFSET 1.04f
|
||||||
#define CHECK_NEARBY_THINGS_MAX_DIST 15.0f
|
#define CHECK_NEARBY_THINGS_MAX_DIST 15.0f
|
||||||
|
#define ENTER_CAR_MAX_DIST 30.0f
|
||||||
|
|
||||||
struct CPathNode;
|
struct CPathNode;
|
||||||
class CAccident;
|
class CAccident;
|
||||||
|
Loading…
Reference in New Issue
Block a user