Skip to content

Commit

Permalink
- file system update from Raze.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Aug 11, 2021
1 parent 3adadfe commit 26d00e1
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/common/filesystem/filesystem.cpp
Expand Up @@ -113,7 +113,20 @@ struct FileSystem::LumpRecord
if (Namespace == ns_hidden) shortName.qword = 0;
else
{
long slash = longName.LastIndexOf('/');
ptrdiff_t encodedResID = longName.LastIndexOf(".{");
if (resourceId == -1 && encodedResID >= 0)
{
const char* p = longName.GetChars() + encodedResID;
char* q;
int id = (int)strtoull(p+2, &q, 10); // only decimal numbers allowed here.
if (q[0] == '}' && (q[1] == '.' || q[1] == 0))
{
FString toDelete(p, q - p + 1);
longName.Substitute(toDelete, "");
resourceId = id;
}
}
ptrdiff_t slash = longName.LastIndexOf('/');
FString base = (slash >= 0) ? longName.Mid(slash + 1) : longName;
auto dot = base.LastIndexOf('.');
if (dot >= 0) base.Truncate(dot);
Expand Down

0 comments on commit 26d00e1

Please sign in to comment.