Skip to content

Commit

Permalink
Fixed a bug causing cursors to be extracted improperly.
Browse files Browse the repository at this point in the history
  • Loading branch information
JusticeRage committed Nov 24, 2018
1 parent d7aca8c commit 00a3f84
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion manape/resources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,9 @@ std::vector<boost::uint8_t> reconstruct_icon(pgroup_icon_directory directory, co
for (auto it = resources.begin(); it != resources.end(); ++it)
{
auto type = (*it)->get_type();
if ((*it)->get_id() == directory->Entries[i]->Id && type && *type == "RT_ICON")
// Because there can be duplicate resource IDs, only consider the ones exhibiting the right type.
if ((*it)->get_id() == directory->Entries[i]->Id && type &&
((*type == "RT_ICON" && directory->Type == 1) || (*type == "RT_CURSOR" && directory->Type == 2)))
{
icon = *it;
break;
Expand Down

0 comments on commit 00a3f84

Please sign in to comment.