1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 06:00:00 +00:00

Sync Frontend, Peds with miami 2

This commit is contained in:
erorcun 2020-12-12 18:20:21 +03:00
parent fc3cdf3b3b
commit 3038fba9ca
3 changed files with 111 additions and 125 deletions

View file

@ -312,12 +312,33 @@ const char* MenuFilenames[][2] = {
m_nMenuFadeAlpha = 0; \ m_nMenuFadeAlpha = 0; \
} while(0) } while(0)
#define PREPARE_MENU_HEADER \ #define SET_FONT_FOR_MENU_HEADER \
CFont::SetColor(CRGBA(HEADER_COLOR.r, HEADER_COLOR.g, HEADER_COLOR.b, FadeIn(255))); \ CFont::SetColor(CRGBA(HEADER_COLOR.r, HEADER_COLOR.g, HEADER_COLOR.b, FadeIn(255))); \
CFont::SetRightJustifyOn(); \ CFont::SetRightJustifyOn(); \
CFont::SetScale(MENU_X(MENUHEADER_WIDTH), MENU_Y(MENUHEADER_HEIGHT)); \ CFont::SetScale(MENU_X(MENUHEADER_WIDTH), MENU_Y(MENUHEADER_HEIGHT)); \
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING)); CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
#define RESET_FONT_FOR_NEW_PAGE \
CFont::SetBackgroundOff(); \
CFont::SetScale(MENU_X(MENUACTION_SCALE_MULT), MENU_Y(MENUACTION_SCALE_MULT)); \
CFont::SetPropOn(); \
CFont::SetCentreOff(); \
CFont::SetJustifyOn(); \
CFont::SetRightJustifyOff(); \
CFont::SetBackGroundOnlyTextOn(); \
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_X_MARGIN)); \
CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(MENU_X_MARGIN - 2.0f));
#define SET_FONT_FOR_HELPER_TEXT \
CFont::SetCentreOn(); \
CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE), MENU_Y(SMALLESTTEXT_Y_SCALE)); \
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
#define SET_FONT_FOR_LIST_ITEM \
CFont::SetRightJustifyOff(); \
CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE), MENU_Y(SMALLESTTEXT_Y_SCALE)); \
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
#define ProcessSlider(value, increaseAction, decreaseAction, hoverStartX, hoverEndX) \ #define ProcessSlider(value, increaseAction, decreaseAction, hoverStartX, hoverEndX) \
do { \ do { \
lastActiveBarX = DisplaySlider(MENU_X_RIGHT_ALIGNED(MENUSLIDER_X + columnWidth), MENU_Y(bitAboveNextItemY), MENU_Y(smallestSliderBar), MENU_Y(usableLineHeight), MENU_X(MENUSLIDER_UNK), value); \ lastActiveBarX = DisplaySlider(MENU_X_RIGHT_ALIGNED(MENUSLIDER_X + columnWidth), MENU_Y(bitAboveNextItemY), MENU_Y(smallestSliderBar), MENU_Y(usableLineHeight), MENU_X(MENUSLIDER_UNK), value); \
@ -512,6 +533,7 @@ CMenuManager::ProcessList(bool &goBack, bool &optionSelected)
m_nTotalListRow = m_nSkinsTotal; m_nTotalListRow = m_nSkinsTotal;
} }
if (m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS) { if (m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS) {
// GetNumOptionsCntrlConfigScreens would have been a better choice
m_nTotalListRow = m_ControlMethod == CONTROL_CLASSIC ? 30 : 25; m_nTotalListRow = m_ControlMethod == CONTROL_CLASSIC ? 30 : 25;
if (m_nSelectedListRow > m_nTotalListRow) if (m_nSelectedListRow > m_nTotalListRow)
m_nSelectedListRow = m_nTotalListRow - 1; m_nSelectedListRow = m_nTotalListRow - 1;
@ -932,10 +954,7 @@ CMenuManager::DisplayHelperText()
alpha = m_nHelperTextAlpha > 255 ? 255 : m_nHelperTextAlpha; alpha = m_nHelperTextAlpha > 255 ? 255 : m_nHelperTextAlpha;
} }
CFont::SetCentreOn(); SET_FONT_FOR_HELPER_TEXT
CFont::SetScale(SCREEN_SCALE_X(SMALLESTTEXT_X_SCALE), SCREEN_SCALE_Y(SMALLESTTEXT_Y_SCALE));
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
// TODO: name this cases? // TODO: name this cases?
switch (m_nHelperTextMsgId) { switch (m_nHelperTextMsgId) {
case 0: case 0:
@ -1065,7 +1084,7 @@ CMenuManager::Draw()
#endif #endif
if (aScreens[m_nCurrScreen].m_ScreenName[0] != '\0') { if (aScreens[m_nCurrScreen].m_ScreenName[0] != '\0') {
PREPARE_MENU_HEADER SET_FONT_FOR_MENU_HEADER
CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName)); CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
// Weird place to put that. // Weird place to put that.
@ -1876,6 +1895,7 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
int controllerAction = PED_FIREWEAPON; int controllerAction = PED_FIREWEAPON;
// GetStartOptionsCntrlConfigScreens(); // GetStartOptionsCntrlConfigScreens();
int numOptions = GetNumOptionsCntrlConfigScreens(); int numOptions = GetNumOptionsCntrlConfigScreens();
int nextY = MENU_Y(yStart);
int bindingMargin = MENU_X(3.0f); int bindingMargin = MENU_X(3.0f);
float rowHeight; float rowHeight;
switch (m_ControlMethod) { switch (m_ControlMethod) {
@ -1890,9 +1910,10 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
} }
// MENU_Y(rowHeight * 0.0f + yStart); // MENU_Y(rowHeight * 0.0f + yStart);
for (int optionIdx = 0, nextY = MENU_Y(yStart); optionIdx < numOptions; nextY = MENU_Y(++optionIdx * rowHeight + yStart)) { for (int optionIdx = 0; optionIdx < numOptions; nextY = MENU_Y(++optionIdx * rowHeight + yStart)) {
int nextX = xStart; int nextX = xStart;
int bindingsForThisOpt = 0; int bindingsForThisOpt = 0;
int contSetOrder = SETORDER_1;
CFont::SetColor(CRGBA(LIST_OPTION_COLOR.r, LIST_OPTION_COLOR.g, LIST_OPTION_COLOR.b, FadeIn(LIST_OPTION_COLOR.a))); CFont::SetColor(CRGBA(LIST_OPTION_COLOR.r, LIST_OPTION_COLOR.g, LIST_OPTION_COLOR.b, FadeIn(LIST_OPTION_COLOR.a)));
if (column == CONTSETUP_PED_COLUMN) { if (column == CONTSETUP_PED_COLUMN) {
@ -2112,7 +2133,7 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
// Print bindings, including seperator (-) between them // Print bindings, including seperator (-) between them
CFont::SetScale(MENU_X(0.25f), MENU_Y(0.6f)); CFont::SetScale(MENU_X(0.25f), MENU_Y(0.6f));
for (int contSetOrder = SETORDER_1; contSetOrder < MAX_SETORDERS && controllerAction != -1; contSetOrder++) { for (; contSetOrder < MAX_SETORDERS && controllerAction != -1; contSetOrder++) {
wchar *settingText = ControlsManager.GetControllerSettingTextWithOrderNumber((e_ControllerAction)controllerAction, (eContSetOrder)contSetOrder); wchar *settingText = ControlsManager.GetControllerSettingTextWithOrderNumber((e_ControllerAction)controllerAction, (eContSetOrder)contSetOrder);
if (settingText) { if (settingText) {
++bindingsForThisOpt; ++bindingsForThisOpt;
@ -2176,9 +2197,7 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
CFont::SetColor(CRGBA(55, 55, 55, FadeIn(255))); CFont::SetColor(CRGBA(55, 55, 55, FadeIn(255)));
CFont::PrintString(nextX, nextY, TheText.Get("FEC_QUE")); // "???" CFont::PrintString(nextX, nextY, TheText.Get("FEC_QUE")); // "???"
} }
CFont::SetCentreOn(); SET_FONT_FOR_HELPER_TEXT
CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE), MENU_Y(SMALLESTTEXT_Y_SCALE));
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
CFont::SetColor(CRGBA(255, 255, 255, FadeIn(255))); CFont::SetColor(CRGBA(255, 255, 255, FadeIn(255)));
if (m_bKeyChangeNotProcessed) { if (m_bKeyChangeNotProcessed) {
CFont::PrintString(MENU_X_LEFT_ALIGNED(275.0f), SCREEN_SCALE_FROM_BOTTOM(114.0f), TheText.Get("FET_CIG")); // BACKSPACE TO CLEAR - LMB,RETURN TO CHANGE CFont::PrintString(MENU_X_LEFT_ALIGNED(275.0f), SCREEN_SCALE_FROM_BOTTOM(114.0f), TheText.Get("FET_CIG")); // BACKSPACE TO CLEAR - LMB,RETURN TO CHANGE
@ -2186,34 +2205,24 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
CFont::PrintString(MENU_X_LEFT_ALIGNED(275.0f), SCREEN_SCALE_FROM_BOTTOM(114.0f), TheText.Get("FET_RIG")); // SELECT A NEW CONTROL FOR THIS ACTION OR ESC TO CANCEL CFont::PrintString(MENU_X_LEFT_ALIGNED(275.0f), SCREEN_SCALE_FROM_BOTTOM(114.0f), TheText.Get("FET_RIG")); // SELECT A NEW CONTROL FOR THIS ACTION OR ESC TO CANCEL
} }
CFont::SetRightJustifyOff(); SET_FONT_FOR_LIST_ITEM
CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE), MENU_Y(SMALLESTTEXT_Y_SCALE));
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
if (!m_bKeyIsOK) if (!m_bKeyIsOK)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SETTING_CHANGE, 0);
m_bKeyIsOK = true; m_bKeyIsOK = true;
} else { } else {
CFont::SetCentreOn(); SET_FONT_FOR_HELPER_TEXT
CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE), MENU_Y(SMALLESTTEXT_Y_SCALE));
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
CFont::SetColor(CRGBA(255, 255, 255, FadeIn(255))); CFont::SetColor(CRGBA(255, 255, 255, FadeIn(255)));
CFont::PrintString(MENU_X_LEFT_ALIGNED(275.0f), SCREEN_SCALE_FROM_BOTTOM(114.0f), TheText.Get("FET_CIG")); // BACKSPACE TO CLEAR - LMB,RETURN TO CHANGE CFont::PrintString(MENU_X_LEFT_ALIGNED(275.0f), SCREEN_SCALE_FROM_BOTTOM(114.0f), TheText.Get("FET_CIG")); // BACKSPACE TO CLEAR - LMB,RETURN TO CHANGE
CFont::SetRightJustifyOff(); SET_FONT_FOR_LIST_ITEM
CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE), MENU_Y(SMALLESTTEXT_Y_SCALE));
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
m_bKeyIsOK = false; m_bKeyIsOK = false;
m_bKeyChangeNotProcessed = false; m_bKeyChangeNotProcessed = false;
} }
} else if (optionIdx == m_nSelectedListRow) { } else if (optionIdx == m_nSelectedListRow) {
CFont::SetCentreOn(); SET_FONT_FOR_HELPER_TEXT
CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE), MENU_Y(SMALLESTTEXT_Y_SCALE));
CFont::SetFontStyle(FONT_LOCALE(FONT_HEADING));
CFont::SetColor(CRGBA(55, 55, 55, FadeIn(255))); CFont::SetColor(CRGBA(55, 55, 55, FadeIn(255)));
CFont::PrintString(MENU_X_LEFT_ALIGNED(275.0f), SCREEN_SCALE_FROM_BOTTOM(114.0f), TheText.Get("FET_EIG")); // CANNOT SET A CONTROL FOR THIS ACTION CFont::PrintString(MENU_X_LEFT_ALIGNED(275.0f), SCREEN_SCALE_FROM_BOTTOM(114.0f), TheText.Get("FET_EIG")); // CANNOT SET A CONTROL FOR THIS ACTION
CFont::SetRightJustifyOff(); SET_FONT_FOR_LIST_ITEM
CFont::SetScale(MENU_X(SMALLESTTEXT_X_SCALE), MENU_Y(SMALLESTTEXT_Y_SCALE));
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
} }
} }
} }
@ -2289,17 +2298,9 @@ CMenuManager::DrawControllerSetupScreen()
default: default:
break; break;
} }
CFont::SetBackgroundOff(); RESET_FONT_FOR_NEW_PAGE
CFont::SetScale(MENU_X(MENUACTION_SCALE_MULT), MENU_Y(MENUACTION_SCALE_MULT));
CFont::SetPropOn();
CFont::SetCentreOff();
CFont::SetJustifyOn();
CFont::SetRightJustifyOff();
CFont::SetBackGroundOnlyTextOn();
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_X_MARGIN));
CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(MENU_X_MARGIN - 2.0f));
PREPARE_MENU_HEADER SET_FONT_FOR_MENU_HEADER
switch (m_ControlMethod) { switch (m_ControlMethod) {
case CONTROL_STANDARD: case CONTROL_STANDARD:
@ -2374,15 +2375,15 @@ CMenuManager::DrawControllerSetupScreen()
CFont::PrintString(MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_1_X), MENU_Y(CONTSETUP_LIST_TOP), TheText.Get("FET_CAC")); CFont::PrintString(MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_1_X), MENU_Y(CONTSETUP_LIST_TOP), TheText.Get("FET_CAC"));
CFont::PrintString(MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_2_X), MENU_Y(CONTSETUP_LIST_TOP), TheText.Get("FET_CFT")); CFont::PrintString(MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_2_X), MENU_Y(CONTSETUP_LIST_TOP), TheText.Get("FET_CFT"));
CFont::PrintString(MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_3_X), MENU_Y(CONTSETUP_LIST_TOP), TheText.Get("FET_CCR")); CFont::PrintString(MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_3_X), MENU_Y(CONTSETUP_LIST_TOP), TheText.Get("FET_CCR"));
CFont::SetRightJustifyOff(); SET_FONT_FOR_LIST_ITEM
CFont::SetScale(MENU_X_LEFT_ALIGNED(SMALLESTTEXT_X_SCALE), MENU_Y(SMALLESTTEXT_Y_SCALE));
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
int yStart; int yStart;
if (m_ControlMethod == CONTROL_CLASSIC) if (m_ControlMethod == CONTROL_CLASSIC)
yStart = CONTSETUP_LIST_HEADER_HEIGHT + 29; yStart = CONTSETUP_LIST_TOP + CONTSETUP_LIST_HEADER_HEIGHT + 1;
else else
yStart = CONTSETUP_LIST_HEADER_HEIGHT + 34; yStart = CONTSETUP_LIST_TOP + CONTSETUP_LIST_HEADER_HEIGHT + 5;
float optionYBottom = yStart + rowHeight;
for (int i = 0; i < ARRAY_SIZE(actionTexts); ++i) { for (int i = 0; i < ARRAY_SIZE(actionTexts); ++i) {
wchar *actionText = actionTexts[i]; wchar *actionText = actionTexts[i];
if (!actionText) if (!actionText)
@ -2391,8 +2392,7 @@ CMenuManager::DrawControllerSetupScreen()
if (m_nMousePosX > MENU_X_LEFT_ALIGNED(CONTSETUP_LIST_LEFT + 2.0f) && if (m_nMousePosX > MENU_X_LEFT_ALIGNED(CONTSETUP_LIST_LEFT + 2.0f) &&
m_nMousePosX < MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_3_X + CONTSETUP_BOUND_COLUMN_WIDTH)) { m_nMousePosX < MENU_X_LEFT_ALIGNED(CONTSETUP_COLUMN_3_X + CONTSETUP_BOUND_COLUMN_WIDTH)) {
float curOptY = i * rowHeight + yStart; if (m_nMousePosY > MENU_Y(i * rowHeight + yStart) && m_nMousePosY < MENU_Y(i * rowHeight + optionYBottom)) {
if (m_nMousePosY > MENU_Y(curOptY) && m_nMousePosY < MENU_Y(rowHeight + curOptY)) {
if (m_nOptionMouseHovering != i && m_nCurrExLayer == HOVEROPTION_LIST) if (m_nOptionMouseHovering != i && m_nCurrExLayer == HOVEROPTION_LIST)
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NAVIGATION, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NAVIGATION, 0);
@ -3042,17 +3042,9 @@ CMenuManager::DrawFrontEndNormal()
void void
CMenuManager::DrawPlayerSetupScreen() CMenuManager::DrawPlayerSetupScreen()
{ {
CFont::SetBackgroundOff(); RESET_FONT_FOR_NEW_PAGE
CFont::SetScale(MENU_X(MENUACTION_SCALE_MULT), MENU_Y(MENUACTION_SCALE_MULT));
CFont::SetPropOn();
CFont::SetCentreOff();
CFont::SetJustifyOn();
CFont::SetRightJustifyOff();
CFont::SetBackGroundOnlyTextOn();
CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_X_MARGIN));
CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(MENU_X_MARGIN - 2.0f));
PREPARE_MENU_HEADER SET_FONT_FOR_MENU_HEADER
CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get("FET_PS")); CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get("FET_PS"));
@ -4018,7 +4010,7 @@ CMenuManager::PrintStats()
// ::Draw already does that. // ::Draw already does that.
/* /*
PREPARE_MENU_HEADER SET_FONT_FOR_MENU_HEADER
CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName)); CFont::PrintString(PAGE_NAME_X(MENUHEADER_POS_X), SCREEN_SCALE_FROM_BOTTOM(MENUHEADER_POS_Y), TheText.Get(aScreens[m_nCurrScreen].m_ScreenName));
*/ */
CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X), MENU_Y(MENU_TEXT_SIZE_Y)); CFont::SetScale(MENU_X(MENU_TEXT_SIZE_X), MENU_Y(MENU_TEXT_SIZE_Y));

View file

@ -972,9 +972,9 @@ CPed::ProcessObjective(void)
} }
CWeaponInfo *wepInfo = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType); CWeaponInfo *wepInfo = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType);
float wepRange = wepInfo->m_fRange; float wepRange = wepInfo->m_fRange;
float wepRangeAdjusted; float maxDistToKeep;
if (GetWeapon()->m_eWeaponType != WEAPONTYPE_UNARMED) { if (GetWeapon()->m_eWeaponType != WEAPONTYPE_UNARMED) {
wepRangeAdjusted = wepRange / 3.0f; maxDistToKeep = wepRange / 3.0f;
} else { } else {
if (m_nPedState == PED_FIGHT) { if (m_nPedState == PED_FIGHT) {
if (!IsPlayer() && !(m_pedStats->m_flags & STAT_CAN_KICK)) if (!IsPlayer() && !(m_pedStats->m_flags & STAT_CAN_KICK))
@ -982,10 +982,10 @@ CPed::ProcessObjective(void)
} else { } else {
wepRange = 1.3f; wepRange = 1.3f;
} }
wepRangeAdjusted = wepRange; maxDistToKeep = wepRange;
} }
if (m_pedInObjective->m_getUpTimer > CTimer::GetTimeInMilliseconds() && wepRangeAdjusted < 2.5f) { if (m_pedInObjective->m_getUpTimer > CTimer::GetTimeInMilliseconds() && maxDistToKeep < 2.5f) {
wepRangeAdjusted = 2.5f; maxDistToKeep = 2.5f;
} }
if (m_pedInObjective->IsPlayer() && m_nPedType != PEDTYPE_COP if (m_pedInObjective->IsPlayer() && m_nPedType != PEDTYPE_COP
&& CharCreatedBy != MISSION_CHAR && FindPlayerPed()->m_pWanted->m_CurrentCops) { && CharCreatedBy != MISSION_CHAR && FindPlayerPed()->m_pWanted->m_CurrentCops) {
@ -1086,7 +1086,7 @@ CPed::ProcessObjective(void)
|| distWithTargetSc > m_distanceToCountSeekDone && !CanSeeEntity(m_pedInObjective)) { || distWithTargetSc > m_distanceToCountSeekDone && !CanSeeEntity(m_pedInObjective)) {
if (m_pedInObjective->EnteringCar()) if (m_pedInObjective->EnteringCar())
wepRangeAdjusted = 2.0f; maxDistToKeep = 2.0f;
if (bUsePedNodeSeek) { if (bUsePedNodeSeek) {
CVector bestCoords(0.0f, 0.0f, 0.0f); CVector bestCoords(0.0f, 0.0f, 0.0f);
@ -1100,7 +1100,7 @@ CPed::ProcessObjective(void)
SetSeek(m_vecSeekPos, m_distanceToCountSeekDone); SetSeek(m_vecSeekPos, m_distanceToCountSeekDone);
} else { } else {
SetSeek(m_pedInObjective, wepRangeAdjusted); SetSeek(m_pedInObjective, maxDistToKeep);
} }
bCrouchWhenShooting = false; bCrouchWhenShooting = false;
if (m_pedInObjective->m_pCurrentPhysSurface && distWithTargetSc < 5.0f) { if (m_pedInObjective->m_pCurrentPhysSurface && distWithTargetSc < 5.0f) {
@ -1172,7 +1172,7 @@ CPed::ProcessObjective(void)
SetShootTimer(CGeneral::GetRandomNumberInRange(500.0f, 2000.0f)); SetShootTimer(CGeneral::GetRandomNumberInRange(500.0f, 2000.0f));
int time; int time;
if (distWithTargetSc <= wepRangeAdjusted) if (distWithTargetSc <= maxDistToKeep)
time = CGeneral::GetRandomNumberInRange(100.0f, 500.0f); time = CGeneral::GetRandomNumberInRange(100.0f, 500.0f);
else else
time = CGeneral::GetRandomNumberInRange(1500.0f, 3000.0f); time = CGeneral::GetRandomNumberInRange(1500.0f, 3000.0f);
@ -1230,17 +1230,17 @@ CPed::ProcessObjective(void)
if (m_nPedType == PEDTYPE_COP) { if (m_nPedType == PEDTYPE_COP) {
if (GetWeapon()->m_eWeaponType > WEAPONTYPE_COLT45 if (GetWeapon()->m_eWeaponType > WEAPONTYPE_COLT45
|| m_fleeFrom && m_fleeFrom->IsObject()) { || m_fleeFrom && m_fleeFrom->IsObject()) {
wepRangeAdjusted = 6.0f; maxDistToKeep = 6.0f;
} else if (m_fleeFrom && m_fleeFrom->IsVehicle()) { } else if (m_fleeFrom && m_fleeFrom->IsVehicle()) {
wepRangeAdjusted = 4.0f; maxDistToKeep = 4.0f;
} else { } else {
wepRangeAdjusted = 2.0f; maxDistToKeep = 2.0f;
} }
} else { } else {
wepRangeAdjusted = 2.0f; maxDistToKeep = 2.0f;
} }
} }
if (distWithTargetSc <= wepRangeAdjusted) { if (distWithTargetSc <= maxDistToKeep) {
SetMoveState(PEDMOVE_STILL); SetMoveState(PEDMOVE_STILL);
bIsPointingGunAt = true; bIsPointingGunAt = true;
if (m_nPedState != PED_AIM_GUN && !bDuckAndCover) { if (m_nPedState != PED_AIM_GUN && !bDuckAndCover) {
@ -1251,7 +1251,7 @@ CPed::ProcessObjective(void)
if (m_nPedState != PED_SEEK_ENTITY && m_nPedState != PED_SEEK_POS if (m_nPedState != PED_SEEK_ENTITY && m_nPedState != PED_SEEK_POS
&& !bStopAndShoot && !killPlayerInNoPoliceZone && !bKindaStayInSamePlace) { && !bStopAndShoot && !killPlayerInNoPoliceZone && !bKindaStayInSamePlace) {
Say(SOUND_PED_ATTACK); Say(SOUND_PED_ATTACK);
SetSeek(m_pedInObjective, wepRangeAdjusted); SetSeek(m_pedInObjective, maxDistToKeep);
bIsRunning = true; bIsRunning = true;
} }
} }

View file

@ -113,16 +113,12 @@ CPlayerPed::AnnoyPlayerPed(bool annoyedByPassingEntity)
{ {
if (m_pedStats->m_temper < 52) { if (m_pedStats->m_temper < 52) {
m_pedStats->m_temper++; m_pedStats->m_temper++;
} else { } else if (annoyedByPassingEntity && m_pedStats->m_temper < 55) {
if (annoyedByPassingEntity) {
if (m_pedStats->m_temper < 55) {
m_pedStats->m_temper++; m_pedStats->m_temper++;
} else { } else if (annoyedByPassingEntity) {
m_pedStats->m_temper = 46; m_pedStats->m_temper = 46;
} }
} }
}
}
void void
CPlayerPed::ClearAdrenaline(void) CPlayerPed::ClearAdrenaline(void)
@ -215,7 +211,7 @@ CPlayerPed::ReApplyMoveAnims(void)
for(int i = 0; i < ARRAY_SIZE(moveAnims); i++) { for(int i = 0; i < ARRAY_SIZE(moveAnims); i++) {
CAnimBlendAssociation *curMoveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), moveAnims[i]); CAnimBlendAssociation *curMoveAssoc = RpAnimBlendClumpGetAssociation(GetClump(), moveAnims[i]);
if (curMoveAssoc) { if (curMoveAssoc) {
if (strcmp(CAnimManager::GetAnimAssociation(m_animGroup, moveAnims[i])->hierarchy->name, curMoveAssoc->hierarchy->name) != 0) { if (CGeneral::faststrcmp(CAnimManager::GetAnimAssociation(m_animGroup, moveAnims[i])->hierarchy->name, curMoveAssoc->hierarchy->name)) {
CAnimBlendAssociation *newMoveAssoc = CAnimManager::AddAnimation(GetClump(), m_animGroup, moveAnims[i]); CAnimBlendAssociation *newMoveAssoc = CAnimManager::AddAnimation(GetClump(), m_animGroup, moveAnims[i]);
newMoveAssoc->blendDelta = curMoveAssoc->blendDelta; newMoveAssoc->blendDelta = curMoveAssoc->blendDelta;
newMoveAssoc->blendAmount = curMoveAssoc->blendAmount; newMoveAssoc->blendAmount = curMoveAssoc->blendAmount;
@ -288,7 +284,7 @@ CPlayerPed::SetRealMoveAnim(void)
if (!curIdleAssoc) if (!curIdleAssoc)
curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE); curIdleAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_FIGHT_IDLE);
if ((!curRunStopAssoc || !(curRunStopAssoc->IsRunning())) && (!curRunStopRAssoc || !(curRunStopRAssoc->IsRunning()))) { if (!((curRunStopAssoc && curRunStopAssoc->IsRunning()) || (curRunStopRAssoc && curRunStopRAssoc->IsRunning()))) {
if (curRunStopAssoc && curRunStopAssoc->blendDelta >= 0.0f || curRunStopRAssoc && curRunStopRAssoc->blendDelta >= 0.0f) { if (curRunStopAssoc && curRunStopAssoc->blendDelta >= 0.0f || curRunStopRAssoc && curRunStopRAssoc->blendDelta >= 0.0f) {
if (curRunStopAssoc) { if (curRunStopAssoc) {
@ -340,8 +336,8 @@ CPlayerPed::SetRealMoveAnim(void)
CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 4.0f); CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_IDLE_STANCE, 4.0f);
} }
} }
m_nMoveState = PEDMOVE_STILL; m_nMoveState = PEDMOVE_STILL;
} else { } else {
if (curIdleAssoc) { if (curIdleAssoc) {
if (curWalkStartAssoc) { if (curWalkStartAssoc) {
@ -394,6 +390,7 @@ CPlayerPed::SetRealMoveAnim(void)
} }
if (curSprintAssoc && (m_nMoveState != PEDMOVE_SPRINT || m_fMoveSpeed < 0.4f)) { if (curSprintAssoc && (m_nMoveState != PEDMOVE_SPRINT || m_fMoveSpeed < 0.4f)) {
// Stop sprinting in various conditions
if (curSprintAssoc->blendAmount == 0.0f) { if (curSprintAssoc->blendAmount == 0.0f) {
curSprintAssoc->blendDelta = -1000.0f; curSprintAssoc->blendDelta = -1000.0f;
curSprintAssoc->flags |= ASSOC_DELETEFADEDOUT; curSprintAssoc->flags |= ASSOC_DELETEFADEDOUT;
@ -417,8 +414,8 @@ CPlayerPed::SetRealMoveAnim(void)
curRunAssoc->flags &= ~ASSOC_RUNNING; curRunAssoc->flags &= ~ASSOC_RUNNING;
curRunAssoc->blendAmount = 0.0f; curRunAssoc->blendAmount = 0.0f;
curRunAssoc->blendDelta = 0.0f; curRunAssoc->blendDelta = 0.0f;
} else if (curSprintAssoc->blendDelta >= 0.0f) {
} else if (curSprintAssoc->blendDelta >= 0.0f) {
// Stop sprinting when tired // Stop sprinting when tired
curSprintAssoc->flags |= ASSOC_DELETEFADEDOUT; curSprintAssoc->flags |= ASSOC_DELETEFADEDOUT;
curSprintAssoc->blendDelta = -1.0f; curSprintAssoc->blendDelta = -1.0f;
@ -428,7 +425,9 @@ CPlayerPed::SetRealMoveAnim(void)
curSprintAssoc->blendDelta = -8.0f; curSprintAssoc->blendDelta = -8.0f;
curRunAssoc->blendDelta = 8.0f; curRunAssoc->blendDelta = 8.0f;
} }
} else if (curWalkStartAssoc) { } else if (curWalkStartAssoc) {
// Walk start and walk/run shouldn't run at the same time
curWalkAssoc->flags &= ~ASSOC_RUNNING; curWalkAssoc->flags &= ~ASSOC_RUNNING;
curRunAssoc->flags &= ~ASSOC_RUNNING; curRunAssoc->flags &= ~ASSOC_RUNNING;
curWalkAssoc->blendAmount = 0.0f; curWalkAssoc->blendAmount = 0.0f;
@ -436,11 +435,13 @@ CPlayerPed::SetRealMoveAnim(void)
} else if (m_nMoveState == PEDMOVE_SPRINT) { } else if (m_nMoveState == PEDMOVE_SPRINT) {
if (curSprintAssoc) { if (curSprintAssoc) {
// We have anim, do it
if (curSprintAssoc->blendDelta < 0.0f) { if (curSprintAssoc->blendDelta < 0.0f) {
curSprintAssoc->blendDelta = 2.0f; curSprintAssoc->blendDelta = 2.0f;
curRunAssoc->blendDelta = -2.0f; curRunAssoc->blendDelta = -2.0f;
} }
} else { } else {
// Transition between run-sprint
curWalkAssoc->blendAmount = 0.0f; curWalkAssoc->blendAmount = 0.0f;
curRunAssoc->blendAmount = 1.0f; curRunAssoc->blendAmount = 1.0f;
curSprintAssoc = CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_SPRINT, 2.0f); curSprintAssoc = CAnimManager::BlendAnimation(GetClump(), m_animGroup, ANIM_SPRINT, 2.0f);
@ -703,14 +704,7 @@ CPlayerPed::PlayerControl1stPersonRunAround(CPad *padUsed)
float padMove = CVector2D(leftRight, upDown).Magnitude(); float padMove = CVector2D(leftRight, upDown).Magnitude();
float padMoveInGameUnit = padMove / PAD_MOVE_TO_GAME_WORLD_MOVE; float padMoveInGameUnit = padMove / PAD_MOVE_TO_GAME_WORLD_MOVE;
if (padMoveInGameUnit > 0.0f) { if (padMoveInGameUnit > 0.0f) {
#ifdef FREE_CAM
if (!CCamera::bFreeCam)
m_fRotationDest = CGeneral::LimitRadianAngle(TheCamera.Orientation); m_fRotationDest = CGeneral::LimitRadianAngle(TheCamera.Orientation);
else
m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(0.0f, 0.0f, -leftRight, upDown) - TheCamera.Orientation;
#else
m_fRotationDest = CGeneral::LimitRadianAngle(TheCamera.Orientation);
#endif
m_fMoveSpeed = Min(padMoveInGameUnit, 0.07f * CTimer::GetTimeStep() + m_fMoveSpeed); m_fMoveSpeed = Min(padMoveInGameUnit, 0.07f * CTimer::GetTimeStep() + m_fMoveSpeed);
} else { } else {
m_fMoveSpeed = 0.0f; m_fMoveSpeed = 0.0f;
@ -718,8 +712,7 @@ CPlayerPed::PlayerControl1stPersonRunAround(CPad *padUsed)
if (m_nPedState == PED_JUMP) { if (m_nPedState == PED_JUMP) {
if (bIsInTheAir) { if (bIsInTheAir) {
if (bUsesCollision && !bHitSteepSlope && if (bUsesCollision && !bHitSteepSlope && (!bHitSomethingLastFrame || m_vecDamageNormal.z > 0.6f)
(!bHitSomethingLastFrame || m_vecDamageNormal.z > 0.6f)
&& m_fDistanceTravelled < CTimer::GetTimeStep() * 0.02 && m_vecMoveSpeed.MagnitudeSqr() < 0.01f) { && m_fDistanceTravelled < CTimer::GetTimeStep() * 0.02 && m_vecMoveSpeed.MagnitudeSqr() < 0.01f) {
float angleSin = Sin(m_fRotationCur); // originally sin(DEGTORAD(RADTODEG(m_fRotationCur))) o_O float angleSin = Sin(m_fRotationCur); // originally sin(DEGTORAD(RADTODEG(m_fRotationCur))) o_O
@ -730,8 +723,7 @@ CPlayerPed::PlayerControl1stPersonRunAround(CPad *padUsed)
m_fMoveSpeed = 0.0f; m_fMoveSpeed = 0.0f;
} }
} }
if (!(CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_bHeavy) if (!(CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_bHeavy) && padUsed->GetSprint()) {
&& padUsed->GetSprint()) {
m_nMoveState = PEDMOVE_SPRINT; m_nMoveState = PEDMOVE_SPRINT;
} }
if (m_nPedState != PED_FIGHT) if (m_nPedState != PED_FIGHT)
@ -856,10 +848,9 @@ CPlayerPed::FindNextWeaponLockOnTarget(CEntity *previousTarget, bool lookToLeft)
{ {
CEntity *nextTarget = nil; CEntity *nextTarget = nil;
float weaponRange = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_fRange; float weaponRange = CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_fRange;
// nextTarget = nil; // nextTarget = nil; // duplicate
float lastCloseness = -10000.0f; float lastCloseness = -10000.0f;
// unused // CGeneral::GetATanOfXY(GetForward().x, GetForward().y); // unused
// CGeneral::GetATanOfXY(GetForward().x, GetForward().y);
CVector distVec = previousTarget->GetPosition() - GetPosition(); CVector distVec = previousTarget->GetPosition() - GetPosition();
float referenceBeta = CGeneral::GetATanOfXY(distVec.x, distVec.y); float referenceBeta = CGeneral::GetATanOfXY(distVec.x, distVec.y);
@ -907,7 +898,7 @@ CPlayerPed::FindWeaponLockOnTarget(void)
} }
} }
// nextTarget = nil; // nextTarget = nil; // duplicate
float lastCloseness = -10000.0f; float lastCloseness = -10000.0f;
float referenceBeta = CGeneral::GetATanOfXY(GetForward().x, GetForward().y); float referenceBeta = CGeneral::GetATanOfXY(GetForward().x, GetForward().y);
for (int h = CPools::GetPedPool()->GetSize() - 1; h >= 0; h--) { for (int h = CPools::GetPedPool()->GetSize() - 1; h >= 0; h--) {
@ -1105,7 +1096,7 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
m_fRotationCur += (limitedRotDest - m_fRotationCur) / 2; m_fRotationCur += (limitedRotDest - m_fRotationCur) / 2;
} }
} }
} else if (weaponInfo->m_bCanAimWithArm) } else if (weaponInfo->m_bCanAimWithArm && m_nPedState != PED_ATTACK)
ClearPointGunAt(); ClearPointGunAt();
} }
} }
@ -1212,8 +1203,7 @@ CPlayerPed::PlayerControlZelda(CPad *padUsed)
if (m_nPedState == PED_JUMP) { if (m_nPedState == PED_JUMP) {
if (bIsInTheAir) { if (bIsInTheAir) {
if (bUsesCollision && !bHitSteepSlope && if (bUsesCollision && !bHitSteepSlope && (!bHitSomethingLastFrame || m_vecDamageNormal.z > 0.6f)
(!bHitSomethingLastFrame || m_vecDamageNormal.z > 0.6f)
&& m_fDistanceTravelled < CTimer::GetTimeStep() * 0.02 && m_vecMoveSpeed.MagnitudeSqr() < 0.01f) { && m_fDistanceTravelled < CTimer::GetTimeStep() * 0.02 && m_vecMoveSpeed.MagnitudeSqr() < 0.01f) {
float angleSin = Sin(m_fRotationCur); // originally sin(DEGTORAD(RADTODEG(m_fRotationCur))) o_O float angleSin = Sin(m_fRotationCur); // originally sin(DEGTORAD(RADTODEG(m_fRotationCur))) o_O
@ -1225,8 +1215,7 @@ CPlayerPed::PlayerControlZelda(CPad *padUsed)
} }
} }
if (!(CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_bHeavy) if (!(CWeaponInfo::GetWeaponInfo(GetWeapon()->m_eWeaponType)->m_bHeavy) && padUsed->GetSprint()) {
&& padUsed->GetSprint()) {
m_nMoveState = PEDMOVE_SPRINT; m_nMoveState = PEDMOVE_SPRINT;
} }
if (m_nPedState != PED_FIGHT) if (m_nPedState != PED_FIGHT)
@ -1291,17 +1280,17 @@ CPlayerPed::ProcessControl(void)
if (m_nPedState == PED_DRIVING && m_objective != OBJECTIVE_LEAVE_CAR) { if (m_nPedState == PED_DRIVING && m_objective != OBJECTIVE_LEAVE_CAR) {
if (m_pMyVehicle->IsCar() && ((CAutomobile*)m_pMyVehicle)->Damage.GetDoorStatus(DOOR_FRONT_LEFT) == DOOR_STATUS_SWINGING) { if (m_pMyVehicle->IsCar() && ((CAutomobile*)m_pMyVehicle)->Damage.GetDoorStatus(DOOR_FRONT_LEFT) == DOOR_STATUS_SWINGING) {
CAnimBlendAssociation *rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_ROLLDOOR); CAnimBlendAssociation *rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_ROLLDOOR);
if (!rollDoorAssoc) {
rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_ROLLDOOR_LOW);
}
// These comparisons are wrong, they return uint16
if (m_pMyVehicle->m_nGettingOutFlags & CAR_DOOR_FLAG_LF || rollDoorAssoc || padUsed
&& (padUsed->GetAccelerate() != 0.0f || padUsed->GetSteeringLeftRight() != 0.0f
|| padUsed->GetBrake() != 0.0f)) {
if (m_pMyVehicle->m_nGettingOutFlags & CAR_DOOR_FLAG_LF || rollDoorAssoc || (rollDoorAssoc = RpAnimBlendClumpGetAssociation(GetClump(), ANIM_CAR_ROLLDOOR_LOW))) {
if (rollDoorAssoc) if (rollDoorAssoc)
m_pMyVehicle->ProcessOpenDoor(CAR_DOOR_LF, ANIM_CAR_ROLLDOOR, rollDoorAssoc->currentTime); m_pMyVehicle->ProcessOpenDoor(CAR_DOOR_LF, ANIM_CAR_ROLLDOOR, rollDoorAssoc->currentTime);
} else {
// These comparisons are wrong, they return uint16
if (padUsed && (padUsed->GetAccelerate() != 0.0f || padUsed->GetSteeringLeftRight() != 0.0f || padUsed->GetBrake() != 0.0f)) {
if (rollDoorAssoc)
m_pMyVehicle->ProcessOpenDoor(CAR_DOOR_LF, ANIM_CAR_ROLLDOOR, rollDoorAssoc->currentTime);
} else { } else {
m_pMyVehicle->m_nGettingOutFlags |= CAR_DOOR_FLAG_LF; m_pMyVehicle->m_nGettingOutFlags |= CAR_DOOR_FLAG_LF;
if (m_pMyVehicle->bLowVehicle) if (m_pMyVehicle->bLowVehicle)
@ -1312,6 +1301,7 @@ CPlayerPed::ProcessControl(void)
rollDoorAssoc->SetFinishCallback(PedAnimDoorCloseRollingCB, this); rollDoorAssoc->SetFinishCallback(PedAnimDoorCloseRollingCB, this);
} }
} }
}
return; return;
} }
if (m_objective == OBJECTIVE_NONE) if (m_objective == OBJECTIVE_NONE)
@ -1338,12 +1328,18 @@ CPlayerPed::ProcessControl(void)
case PED_FIGHT: case PED_FIGHT:
case PED_AIM_GUN: case PED_AIM_GUN:
if (!RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_BLOCK)) { if (!RpAnimBlendClumpGetFirstAssociation(GetClump(), ASSOC_BLOCK)) {
if (TheCamera.Cams[0].Using3rdPersonMouseCam()) { if (TheCamera.Cams[0].Using3rdPersonMouseCam()
#ifdef FREE_CAM
&& !CCamera::bFreeCam
#endif
) {
if (padUsed) if (padUsed)
PlayerControl1stPersonRunAround(padUsed); PlayerControl1stPersonRunAround(padUsed);
} else if (m_nPedState == PED_FIGHT) { } else if (m_nPedState == PED_FIGHT) {
if (padUsed) if (padUsed)
PlayerControlFighter(padUsed); PlayerControlFighter(padUsed);
} else if (padUsed) { } else if (padUsed) {
PlayerControlZelda(padUsed); PlayerControlZelda(padUsed);
} }
@ -1415,6 +1411,7 @@ CPlayerPed::ProcessControl(void)
if (FindPlayerPed()->GetWeapon()->m_eWeaponType == WEAPONTYPE_M16) { if (FindPlayerPed()->GetWeapon()->m_eWeaponType == WEAPONTYPE_M16) {
if (padUsed) if (padUsed)
PlayerControlM16(padUsed); PlayerControlM16(padUsed);
} else if (padUsed) { } else if (padUsed) {
PlayerControlSniper(padUsed); PlayerControlSniper(padUsed);
} }
@ -1477,20 +1474,17 @@ CPlayerPed::ProcessControl(void)
m_lookTimer = 0; m_lookTimer = 0;
float camAngle = CGeneral::LimitRadianAngle(TheCamera.Cams[TheCamera.ActiveCam].Front.Heading()); float camAngle = CGeneral::LimitRadianAngle(TheCamera.Cams[TheCamera.ActiveCam].Front.Heading());
float angleBetweenPlayerAndCam = Abs(camAngle - m_fRotationCur); float angleBetweenPlayerAndCam = Abs(camAngle - m_fRotationCur);
if (m_nPedState != PED_ATTACK if (m_nPedState != PED_ATTACK && angleBetweenPlayerAndCam > DEGTORAD(30.0f) && angleBetweenPlayerAndCam < DEGTORAD(330.0f)) {
&& angleBetweenPlayerAndCam > DEGTORAD(30.0f) && angleBetweenPlayerAndCam < DEGTORAD(330.0f)) {
if (angleBetweenPlayerAndCam > DEGTORAD(150.0f) && angleBetweenPlayerAndCam < DEGTORAD(210.0f)) { if (angleBetweenPlayerAndCam > DEGTORAD(150.0f) && angleBetweenPlayerAndCam < DEGTORAD(210.0f)) {
float rightTurnAngle = CGeneral::LimitRadianAngle(m_fRotationCur - DEGTORAD(150.0f)); float rightTurnAngle = CGeneral::LimitRadianAngle(m_fRotationCur - DEGTORAD(150.0f));
float leftTurnAngle = CGeneral::LimitRadianAngle(DEGTORAD(150.0f) + m_fRotationCur); float leftTurnAngle = CGeneral::LimitRadianAngle(DEGTORAD(150.0f) + m_fRotationCur);
if (m_fLookDirection != 999999.0f) { if (m_fLookDirection == 999999.0f)
if (Abs(rightTurnAngle - m_fLookDirection) < Abs(leftTurnAngle - m_fLookDirection)) camAngle = rightTurnAngle;
else if (Abs(rightTurnAngle - m_fLookDirection) < Abs(leftTurnAngle - m_fLookDirection))
camAngle = rightTurnAngle; camAngle = rightTurnAngle;
else else
camAngle = leftTurnAngle; camAngle = leftTurnAngle;
} else {
camAngle = rightTurnAngle;
}
} }
SetLookFlag(camAngle, true); SetLookFlag(camAngle, true);
SetLookTimer(CTimer::GetTimeStepInMilliseconds() * 5.0f); SetLookTimer(CTimer::GetTimeStepInMilliseconds() * 5.0f);