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
5 changes: 3 additions & 2 deletions src/xrCore/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ void MakeFilter(string1024& dest, pcstr info, pcstr ext)
}
xr_strcpy(dest, res.c_str());

for (size_t i = 0; i < res.size(); ++i)
const auto bound = res.size() > sizeof(dest) ? sizeof(dest) : res.size();
for (size_t i = 0; i < bound; ++i)
{
if (res[i] == '|')
dest[i] = '\0';
Expand Down Expand Up @@ -158,7 +159,7 @@ bool EFS_Utils::GetOpenNameInternal(
string512 path;
xr_strcpy(path, (offset && offset[0]) ? offset : P.m_Path);
ofn.lpstrInitialDir = path;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR |
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR |
(bMulti ? OFN_ALLOWMULTISELECT | OFN_EXPLORER : 0);

ofn.FlagsEx = OFN_EX_NOPLACESBAR;
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/ai/stalker/ai_stalker.h
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ class CAI_Stalker : public CCustomMonster, public CObjectHandler, public CAI_Phr
bool non_conflicted(const CInventoryItem* item, const CWeapon* new_weapon) const;
bool enough_ammo(const CWeapon* new_weapon) const;
bool conflicted(
const CInventoryItem* item, const CWeapon* new_weapon, bool new_wepon_enough_ammo, int new_weapon_rank) const;
const CInventoryItem* item, const CWeapon* new_weapon, bool new_weapon_enough_ammo, int new_weapon_rank) const;
void update_conflicted(CInventoryItem* item, const CWeapon* new_weapon);
void remove_personal_only_ammo(const CInventoryItem* item);
void on_after_take(const CGameObject* object);
Expand Down
6 changes: 3 additions & 3 deletions src/xrGame/ai_stalker_alife.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ bool CAI_Stalker::enough_ammo(const CWeapon* new_weapon) const
}

bool CAI_Stalker::conflicted(
const CInventoryItem* item, const CWeapon* new_weapon, bool new_wepon_enough_ammo, int new_weapon_rank) const
const CInventoryItem* item, const CWeapon* new_weapon, bool new_weapon_enough_ammo, int new_weapon_rank) const
{
if (non_conflicted(item, new_weapon))
return (false);
Expand All @@ -326,10 +326,10 @@ bool CAI_Stalker::conflicted(
VERIFY(weapon);

bool current_weapon_enough_ammo = enough_ammo(weapon);
if (current_weapon_enough_ammo && !new_wepon_enough_ammo)
if (current_weapon_enough_ammo && !new_weapon_enough_ammo)
return (true);

if (!current_weapon_enough_ammo && new_wepon_enough_ammo)
if (!current_weapon_enough_ammo && new_weapon_enough_ammo)
return (false);

if (!fsimilar(weapon->GetCondition(), new_weapon->GetCondition(), .05f))
Expand Down
Loading