Skip to content

Commit 63868c7

Browse files
committed
Fix for the "cannot find rank for" issue
If you can't find the rank, don't crash please
1 parent b538813 commit 63868c7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/xrGame/ui/Restrictions.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,13 @@ u32 get_rank(const shared_str& section)
3131
}
3232
}
3333

34-
R_ASSERT3(res != -1, "cannot find rank for", section.c_str());
34+
if (res == -1)
35+
{
36+
Msg("Setting rank to 0. Cannot find rank for: [%s]", section.c_str());
37+
// Xottab_DUTY: I'm not sure if it's save to leave it -1
38+
res = 0;
39+
}
40+
//R_ASSERT3(res != -1, "cannot find rank for", section.c_str());
3541
return res;
3642
}
3743

0 commit comments

Comments
 (0)