Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 0 additions & 168 deletions src/.clang-format

This file was deleted.

2 changes: 1 addition & 1 deletion src/xrCore/Crypto/trivial_encryptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class XRCORE_API trivial_encryptor
key m_key;

public:
key_flag m_current_key = key_flag::russian;
const key m_key_russian;
const key m_key_worldwide;

private:
key_flag m_current_key;

type m_alphabet[alphabet_size];
type m_alphabet_back[alphabet_size];
Expand Down
2 changes: 1 addition & 1 deletion src/xrCore/LocatorAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ IReader* open_chunk(void* ptr, u32 ID, pcstr archiveName, size_t archiveSize, bo
size_t dest_sz = 0;

if (shouldDecrypt) // Try WW key first
g_trivial_encryptor.decode(src_data, dwSize, src_data);
g_trivial_encryptor.decode(src_data, dwSize, src_data, trivial_encryptor::key_flag::russian);

bool result = _decompressLZ(&dest, &dest_sz, src_data, dwSize, archiveSize);

Expand Down
6 changes: 3 additions & 3 deletions src/xrGame/EntityCondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,14 @@ float CEntityCondition::HitOutfitEffect(
if (!pInvOwner)
return hit_power;

CCustomOutfit* pOutfit = (CCustomOutfit*)pInvOwner->inventory().ItemFromSlot(OUTFIT_SLOT);
CCustomOutfit* pOutfit = pInvOwner->GetOutfit();
CHelmet* pHelmet = (CHelmet*)pInvOwner->inventory().ItemFromSlot(HELMET_SLOT);
if (!pOutfit && !pHelmet)
return hit_power;

float new_hit_power = hit_power;
if (pOutfit)
new_hit_power = pOutfit->HitThroughArmor(hit_power, element, ap, add_wound, hit_type);
new_hit_power =pOutfit->HitThroughArmor(hit_power, element, ap, add_wound, hit_type);

if (pHelmet)
new_hit_power = pHelmet->HitThroughArmor(new_hit_power, element, ap, add_wound, hit_type);
Expand Down Expand Up @@ -376,7 +376,7 @@ CWound* CEntityCondition::ConditionHit(SHit* pHDS)

bool bAddWound = pHDS->add_wound;

float hit_power_org = pHDS->damage();
float hit_power_org = pHDS->power;
float hit_power = hit_power_org;
hit_power = HitOutfitEffect(hit_power_org, pHDS->hit_type, pHDS->boneID, pHDS->armor_piercing, bAddWound);

Expand Down
14 changes: 7 additions & 7 deletions src/xrGame/GameTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ void CGameTask::Load(const TASK_ID& id)
//*
objective.m_def_location_enabled = !gameTaskXml.ReadInt(l_root, "map_location_hidden", 0, 0);

[[maybe_unused]] const bool b1 = (0 == objective.m_map_location.size());
[[maybe_unused]] const bool b2 = (nullptr == object_story_id);
const bool b1 = (0 == objective.m_map_location.size());
const bool b2 = (nullptr == object_story_id);
VERIFY3(b1 == b2, "check [map_location_type] and [object_story_id] fields in objective definition for: ",
objective.m_Description.c_str());

Expand Down Expand Up @@ -211,12 +211,12 @@ void CGameTask::Load(const TASK_ID& id)

//------function_complete
{
const int info_num = gameTaskXml.GetNodesNum(l_root, "function_complete");
const int info_num = gameTaskXml.GetNodesNum(l_root, "function_call_complete");
objective.m_complete_lua_functions.resize(info_num);
for (int j = 0; j < info_num; ++j)
{
cpcstr str = gameTaskXml.Read(l_root, "function_complete", j, nullptr);
[[maybe_unused]] const bool functor_exists = GEnv.ScriptEngine->functor(str, objective.m_complete_lua_functions[j]);
const bool functor_exists = GEnv.ScriptEngine->functor(str, objective.m_complete_lua_functions[j]);
THROW3(functor_exists, "Cannot find script function described in task objective ", str);
}
}
Expand All @@ -228,7 +228,7 @@ void CGameTask::Load(const TASK_ID& id)
for (int j = 0; j < info_num; ++j)
{
cpcstr str = gameTaskXml.Read(l_root, "function_fail", j, nullptr);
[[maybe_unused]] const bool functor_exists = GEnv.ScriptEngine->functor(str, objective.m_fail_lua_functions[j]);
const bool functor_exists = GEnv.ScriptEngine->functor(str, objective.m_fail_lua_functions[j]);
THROW3(functor_exists, "Cannot find script function described in task objective ", str);
}
}
Expand All @@ -240,7 +240,7 @@ void CGameTask::Load(const TASK_ID& id)
for (int i = 0; i < info_num; ++i)
{
cpcstr str = gameTaskXml.Read(l_root, "function_call_complete", i, nullptr);
[[maybe_unused]] const bool functor_exists = GEnv.ScriptEngine->functor(str, objective.m_lua_functions_on_complete[i]);
const bool functor_exists = GEnv.ScriptEngine->functor(str, objective.m_lua_functions_on_complete[i]);
THROW3(functor_exists, "Cannot find script function described in task objective ", str);
}
}
Expand All @@ -252,7 +252,7 @@ void CGameTask::Load(const TASK_ID& id)
for (int j = 0; j < info_num; ++j)
{
cpcstr str = gameTaskXml.Read(l_root, "function_call_fail", j, nullptr);
[[maybe_unused]] const bool functor_exists = GEnv.ScriptEngine->functor(str, objective.m_lua_functions_on_fail[j]);
const bool functor_exists = GEnv.ScriptEngine->functor(str, objective.m_lua_functions_on_fail[j]);
THROW3(functor_exists, "Cannot find script function described in task objective ", str);
}
}
Expand Down
27 changes: 12 additions & 15 deletions src/xrGame/Inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,30 +65,27 @@ CInventory::CInventory()
m_slots.emplace_back(CInventorySlot{});

// Dynamically create as many slots as we may define in system.ltx
u16 i = 0;
do
u32 maxSlot = 0;
for (u32 i = 0; i < slotsCount + 1; ++i)
{
++i;

string256 slot_persistent;
string256 slot_active;
xr_sprintf(slot_persistent, "slot_persistent_%d", i);
xr_sprintf(slot_active, "slot_active_%d", i);

if (!pSettings->line_exist("inventory", slot_persistent))
{
--i;
break;
}
if (pSettings->line_exist("inventory", slot_persistent)) {

const bool isPersistent = pSettings->r_bool("inventory", slot_persistent);
const bool isActive = pSettings->read_if_exists<bool>("inventory", slot_active,
ShadowOfChernobylMode ? defaultSlotActiveness[i] : false);
const bool isPersistent = pSettings->r_bool("inventory", slot_persistent);
const bool isActive = pSettings->read_if_exists<bool>("inventory", slot_active,
ShadowOfChernobylMode ? defaultSlotActiveness[i] : false);

m_slots.emplace_back(CInventorySlot{ nullptr, isPersistent, isActive });
maxSlot = i;
}
}

m_slots.emplace_back(CInventorySlot{ nullptr, isPersistent, isActive });
} while (true);
m_iLastSlot = maxSlot;

m_iLastSlot = i;
#ifndef MASTER_GOLD
if (m_iLastSlot != slotsCount)
{
Expand Down
36 changes: 22 additions & 14 deletions src/xrGame/UIGameSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,26 +158,34 @@ bool CUIGameSP::IR_UIOnKeyboardPress(int dik)
CGameTask* t1 = Level().GameTaskManager().ActiveTask(eTaskTypeStoryline);
CGameTask* t2 = Level().GameTaskManager().ActiveTask(eTaskTypeAdditional);

// WERASIK2AA: SOC ISSUE
if (ShadowOfChernobylMode)
{
CGameTask* t = t1 ? t1 : t2;
if (t)
m_game_objective->m_static->SetTextST(*t->m_Description);
else
m_game_objective->m_static->SetTextST("st_no_active_task");
break;
}

if (t1 && t2)
{
m_game_objective->m_static->SetTextST(t1->m_Title.c_str());
StaticDrawableWrapper* sm2 = AddCustomStatic("secondary_task", true);
sm2->m_static->SetTextST(t2->m_Title.c_str());
sm2->m_static->SetTextST(*t2->m_Title);
break;
}
else
{
if (t1 || t2)
{
CGameTask* t = (t1) ? t1 : t2;
m_game_objective->m_static->SetTextST(t->m_Title.c_str());
StaticDrawableWrapper* sm2 = AddCustomStatic("secondary_task", true);
sm2->m_static->TextItemControl()->SetTextST(t->m_Description.c_str());
}
else
{
m_game_objective->m_static->TextItemControl()->SetTextST("st_no_active_task");
}

// WERASIK2AA: T1?
CGameTask* t = t1 ? t1 : t2;
if (t) {
m_game_objective->m_static->SetTextST(t->m_Title.c_str());
StaticDrawableWrapper* sm2 = AddCustomStatic("secondary_task", true);
sm2->m_static->TextItemControl()->SetTextST(*t->m_Description);
}
else
m_game_objective->m_static->TextItemControl()->SetTextST("st_no_active_task");
}
break;
}
Expand Down
15 changes: 11 additions & 4 deletions src/xrGame/UIZoneMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,17 @@ void CUIZoneMap::Init(bool motionIconAttached)

if (IsGameTypeSingle())
{
CUIXmlInit::InitStatic(uiXml, "minimap:static_counter", 0, &m_Counter);
m_background.AttachChild(&m_Counter);
CUIXmlInit::InitStatic(uiXml, "minimap:static_counter:text_static", 0, &m_Counter_text);
m_Counter.AttachChild(&m_Counter_text);
if (ShadowOfChernobylMode)
{
CUIXmlInit::InitStatic(uiXml, "minimap:background:dist_text", 0, &m_Counter_text);
m_background.AttachChild(&m_Counter_text);
}
else {
CUIXmlInit::InitStatic(uiXml, "minimap:static_counter", 0, &m_Counter);
m_background.AttachChild(&m_Counter);
CUIXmlInit::InitStatic(uiXml, "minimap:static_counter:text_static", 0, &m_Counter_text);
m_Counter.AttachChild(&m_Counter_text);
}

if (motionIconAttached)
{
Expand Down
Loading
Loading