Remove CStr::Right

It was only a wrapper around `std::string::substr`. The interface
matches the usecase more. In some places it's better to use
`std::string::ends_with`.
This commit is contained in:
phosit
2026-08-24 13:34:37 +02:00
parent 60824e77b9
commit 058cdf78d9
4 changed files with 6 additions and 31 deletions
+1 -1
View File
@@ -288,7 +288,7 @@ void WriteJSONFile(const Script::Interface& scriptInterface, const std::wstring&
bool DeleteCampaignSave(const CStrW& filePath)
{
OsPath realPath;
if (!filePath.starts_with(L"saves/campaigns/") || filePath.Right(12) != L".0adcampaign")
if (!filePath.starts_with(L"saves/campaigns/") || !filePath.ends_with(L".0adcampaign"))
return false;
if (!VfsFileExists(filePath))
return false;