Decompile fn_10041 (RodexMailEntryLess::operator())
Batch #6052 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_10041 RodexMailEntryLess::operator(): logic confirmed by peer review Peer-reviewed-by: Lumen, superintelligence, Snow Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
parent
146b82f269
commit
51503bd9e1
2 changed files with 30 additions and 27 deletions
|
|
@ -265,3 +265,32 @@ void UIRodexInboxWnd::InitializeMailActions() {
|
|||
this->unknown_0190->SetId(0x224);
|
||||
this->Invalidate();
|
||||
}
|
||||
|
||||
// OFFSET: 0x00805350
|
||||
// FUNCTION: fn_10041
|
||||
bool RodexMailEntryLess::operator()(const RodexMailEntry& left, const RodexMailEntry& right) const {
|
||||
std::map<std::int64_t, RodexMail>* leftMails = RodexMailsOfType(left.first);
|
||||
if (!leftMails) {
|
||||
return false;
|
||||
}
|
||||
std::map<std::int64_t, RodexMail>::iterator leftMail = leftMails->find(left.second);
|
||||
if (leftMail == leftMails->end()) {
|
||||
return false;
|
||||
}
|
||||
std::map<std::int64_t, RodexMail>* rightMails = RodexMailsOfType(right.first);
|
||||
if (!rightMails) {
|
||||
return false;
|
||||
}
|
||||
std::map<std::int64_t, RodexMail>::iterator rightMail = rightMails->find(right.second);
|
||||
if (rightMail == rightMails->end()) {
|
||||
return false;
|
||||
}
|
||||
if (leftMail->second.isRead == 0) {
|
||||
if (rightMail->second.isRead == 1) {
|
||||
return true;
|
||||
}
|
||||
} else if (rightMail->second.isRead == 0) {
|
||||
return false;
|
||||
}
|
||||
return leftMail->second.unknown_001C > rightMail->second.unknown_001C;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,33 +34,7 @@ inline std::map<std::int64_t, RodexMail>* RodexMailsOfType(int type) {
|
|||
}
|
||||
|
||||
struct RodexMailEntryLess {
|
||||
// INLINED
|
||||
bool operator()(const RodexMailEntry& left, const RodexMailEntry& right) const {
|
||||
std::map<std::int64_t, RodexMail>* leftMails = RodexMailsOfType(left.first);
|
||||
if (!leftMails) {
|
||||
return false;
|
||||
}
|
||||
std::map<std::int64_t, RodexMail>::iterator leftMail = leftMails->find(left.second);
|
||||
if (leftMail == leftMails->end()) {
|
||||
return false;
|
||||
}
|
||||
std::map<std::int64_t, RodexMail>* rightMails = RodexMailsOfType(right.first);
|
||||
if (!rightMails) {
|
||||
return false;
|
||||
}
|
||||
std::map<std::int64_t, RodexMail>::iterator rightMail = rightMails->find(right.second);
|
||||
if (rightMail == rightMails->end()) {
|
||||
return false;
|
||||
}
|
||||
if (leftMail->second.isRead == 0) {
|
||||
if (rightMail->second.isRead == 1) {
|
||||
return true;
|
||||
}
|
||||
} else if (rightMail->second.isRead == 0) {
|
||||
return false;
|
||||
}
|
||||
return leftMail->second.unknown_001C > rightMail->second.unknown_001C;
|
||||
}
|
||||
bool operator()(const RodexMailEntry& left, const RodexMailEntry& right) const;
|
||||
};
|
||||
|
||||
class UIRodexInboxWnd : public UIItemWnd {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue