Batch #4881 by youko: 0 byte-identical, 3 confirmed by peer review. - fn_09985 RodexMailStore::Create: logic confirmed by peer review - fn_09986 RodexMailStore::Destroy: logic confirmed by peer review - fn_09988 RodexMailStore::PurgeFlagged: logic confirmed by peer review Peer-reviewed-by: eAthena, KWDev, Millenium Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
76 lines
1.6 KiB
C++
76 lines
1.6 KiB
C++
#include "Contents/RodexMailStore.h"
|
|
|
|
#include <new>
|
|
|
|
// GLOBAL: gl_24911
|
|
RodexMailStore* g_rodexMailStore;
|
|
|
|
// OFFSET: 0x007FE5E0
|
|
// FUNCTION: fn_09985
|
|
bool RodexMailStore::Create() {
|
|
if (g_rodexMailStore != nullptr) {
|
|
return false;
|
|
}
|
|
|
|
g_rodexMailStore = new (std::nothrow) RodexMailStore();
|
|
if (g_rodexMailStore == nullptr) {
|
|
return false;
|
|
}
|
|
|
|
if (!g_rodexMailStore->m_isValid) {
|
|
delete g_rodexMailStore;
|
|
g_rodexMailStore = nullptr;
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
// OFFSET: 0x007FE7B0
|
|
// FUNCTION: fn_09986
|
|
void RodexMailStore::Destroy() {
|
|
if (g_rodexMailStore != nullptr) {
|
|
delete g_rodexMailStore;
|
|
g_rodexMailStore = nullptr;
|
|
}
|
|
}
|
|
|
|
// OFFSET: 0x007FE7D0
|
|
// FUNCTION: fn_09987
|
|
void RodexMailStore::Clear() {
|
|
this->m_mails0.clear();
|
|
this->m_mails1.clear();
|
|
this->m_mails2.clear();
|
|
this->unknown_0008 = 0;
|
|
this->unknown_000C = 0;
|
|
this->unknown_0010 = false;
|
|
this->unknown_0018 = 0;
|
|
}
|
|
|
|
// OFFSET: 0x007FE850
|
|
// FUNCTION: fn_09988
|
|
void RodexMailStore::PurgeFlagged() {
|
|
for (auto mail = this->m_mails0.begin(); mail != this->m_mails0.end();) {
|
|
if (mail->second.unknown_0190 == 1) {
|
|
mail = this->m_mails0.erase(mail);
|
|
} else {
|
|
++mail;
|
|
}
|
|
}
|
|
|
|
for (auto mail = this->m_mails1.begin(); mail != this->m_mails1.end();) {
|
|
if (mail->second.unknown_0190 == 1) {
|
|
mail = this->m_mails1.erase(mail);
|
|
} else {
|
|
++mail;
|
|
}
|
|
}
|
|
|
|
for (auto mail = this->m_mails2.begin(); mail != this->m_mails2.end();) {
|
|
if (mail->second.unknown_0190 == 1) {
|
|
mail = this->m_mails2.erase(mail);
|
|
} else {
|
|
++mail;
|
|
}
|
|
}
|
|
}
|