From 0ae696c306779d73e7b9a9c8e412661ab7bcd45e Mon Sep 17 00:00:00 2001 From: Graff46 Date: Tue, 24 Jan 2023 06:52:33 +0300 Subject: [PATCH 1/3] No crash if not finded phrase in dialogs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Теперь не будет вылета, если в диалог не нашлась фраза. Диалог будет пустой, у ГГ будет доступна только фраза "прощания" --- ogsr_engine/xrGame/PhraseDialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ogsr_engine/xrGame/PhraseDialog.cpp b/ogsr_engine/xrGame/PhraseDialog.cpp index 52e2f28949..497758b467 100644 --- a/ogsr_engine/xrGame/PhraseDialog.cpp +++ b/ogsr_engine/xrGame/PhraseDialog.cpp @@ -112,7 +112,8 @@ bool CPhraseDialog::SayPhrase(DIALOG_SHARED_PTR& phrase_dialog, const shared_str } } - R_ASSERT2(!phrase_dialog->m_PhraseVector.empty(), make_string("No available phrase to say, dialog[%s]", *phrase_dialog->m_DialogId)); + if (phrase_dialog->m_PhraseVector.empty()) + return !(phrase_dialog->m_bFinished = true); //упорядочить списко по убыванию благосклонности std::sort(phrase_dialog->m_PhraseVector.begin(), phrase_dialog->m_PhraseVector.end(), PhraseGoodwillPred); From 197e94fc7e4fe749dcf3d1e21ac9d1c6c0b9cf7d Mon Sep 17 00:00:00 2001 From: Graff46 Date: Tue, 24 Jan 2023 07:27:01 +0300 Subject: [PATCH 2/3] Added the ability to scale static_wpn_icon on hud MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавлен аттрибут `scale` для тега `static_wpn_icon`, это иконка пачки патронов на худе. Раньше её размеры задавались движком --- ogsr_engine/xrGame/ui/UIMainIngameWnd.cpp | 5 +++-- ogsr_engine/xrGame/ui/UIMainIngameWnd.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ogsr_engine/xrGame/ui/UIMainIngameWnd.cpp b/ogsr_engine/xrGame/ui/UIMainIngameWnd.cpp index 83e52e37ac..52937fa306 100644 --- a/ogsr_engine/xrGame/ui/UIMainIngameWnd.cpp +++ b/ogsr_engine/xrGame/ui/UIMainIngameWnd.cpp @@ -151,6 +151,7 @@ void CUIMainIngameWnd::Init() UIWeaponBack.AttachChild(&UIWeaponIcon); xml_init.InitStatic(uiXml, "static_wpn_icon", 0, &UIWeaponIcon); + static_wpn_icon_scale = uiXml.ReadAttribFlt("static_wpn_icon", 0, "scale", 1.0); UIWeaponIcon.SetShader(GetEquipmentIconsShader()); UIWeaponIcon_rect = UIWeaponIcon.GetWndRect(); //--------------------------------------------------------- @@ -321,8 +322,8 @@ void CUIMainIngameWnd::SetAmmoIcon(const shared_str& sect_name) float iGridWidth = icon_params.grid_width; - float w = std::clamp(iGridWidth, 1.f, 2.f) * INV_GRID_WIDTH; - float h = INV_GRID_HEIGHT; + float w = std::clamp(iGridWidth, 1.f, 2.f) * INV_GRID_WIDTH * static_wpn_icon_scale; + float h = INV_GRID_HEIGHT * static_wpn_icon_scale; w *= UI()->get_current_kx(); float x = UIWeaponIcon_rect.x1; diff --git a/ogsr_engine/xrGame/ui/UIMainIngameWnd.h b/ogsr_engine/xrGame/ui/UIMainIngameWnd.h index 126e6a3770..cb7c72c2a5 100644 --- a/ogsr_engine/xrGame/ui/UIMainIngameWnd.h +++ b/ogsr_engine/xrGame/ui/UIMainIngameWnd.h @@ -145,6 +145,8 @@ class CUIMainIngameWnd : public CUIWindow // Отображение подсказок при наведении прицела на объект void RenderQuickInfos(); + float static_wpn_icon_scale = 1.f; + public: CUICarPanel& CarPanel() { return UICarPanel; }; CUIMotionIcon& MotionIcon() { return UIMotionIcon; } From 2dacdfcb7f034220004a6d8b459d75a5c0cce857 Mon Sep 17 00:00:00 2001 From: "HOME-PC\\User_2" Date: Sat, 4 Mar 2023 02:09:09 +0300 Subject: [PATCH 3/3] Apply force to weapons when loading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Теперь в `net_spawn` класса оружия - оружие получает "пинок". Чтобы выкинутое оружие не "стояло" --- ogsr_engine/xrGame/Weapon.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ogsr_engine/xrGame/Weapon.cpp b/ogsr_engine/xrGame/Weapon.cpp index 9482233a3e..3905a2e8ae 100644 --- a/ogsr_engine/xrGame/Weapon.cpp +++ b/ogsr_engine/xrGame/Weapon.cpp @@ -670,6 +670,12 @@ BOOL CWeapon::net_Spawn(CSE_Abstract* DC) VERIFY((u32)iAmmoElapsed == m_magazine.size()); + if (m_pPhysicsShell) + { + float frc = 5.f * EffectiveGravity() * m_pPhysicsShell->getMass(); + m_pPhysicsShell->applyForce(frc, frc*0.5, 0.f); + } + return bResult; }