mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-25 11:54:40 +01:00
Customization: a mod item's card shows the info sign instead of an empty icon
The warning sign on a mod item's description notice was cleared by writing an empty IconOverride. The game resolves that override again later in its UI update and crashed on the empty one (Skate.exe+0x3e897fb, a lookup that finds nothing): about a quarter of 2.1.0's crash reports, all of them after the sign was cleared. The notice now gets the game's own info sign (img_generic_info_64), set the way the favorites star is. When that texture is not loaded the warning sign stays and it is looked for again two seconds later; an empty override is never written. Texture assets are matched by name ignoring case.
This commit is contained in:
1 parent
c7bf7a1edf
commit
2b5772bdf5
2 files changed
+26
-9
No files matched your search
@@ -422,10 +422,11 @@ bool with_texture_assets(const Context& context, const std::array<std::string_vi
|
||||
if (!table || !buckets || buckets > 65536 || count > 32768) return false;
|
||||
std::array<Address, N> assets{};
|
||||
unsigned visited{};
|
||||
// (Ignoring case: assets keep the case they were authored with, which is not always lower.)
|
||||
const auto matches = [](Address text, std::string_view name) {
|
||||
std::array<char, 256> bytes{};
|
||||
return name.size() < bytes.size() && memory::read_bytes(text, bytes.data(), name.size() + 1) &&
|
||||
bytes[name.size()] == '\0' && std::memcmp(bytes.data(), name.data(), name.size()) == 0;
|
||||
bytes[name.size()] == '\0' && _strnicmp(bytes.data(), name.data(), name.size()) == 0;
|
||||
};
|
||||
const auto complete = [&] { return std::all_of(assets.begin(), assets.end(), [](Address a) { return a != 0; }); };
|
||||
for (unsigned i = 0; i < buckets && !complete(); ++i) {
|
||||
|
||||
Reference in new issue
Block a user