Decompile fn_06504 (CPrivateAirplaneMgr::Create)

Batch #13272 by cremane: 0 byte-identical, 1 confirmed by peer review.

- fn_06504 CPrivateAirplaneMgr::Create: logic confirmed by peer review

Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-06 12:31:57 +00:00
commit ac64bca2d9
2 changed files with 14 additions and 8 deletions

View file

@ -23,18 +23,22 @@ bool CPrivateAirplaneMgr::Create() {
}
g_privateAirplaneItems = new (std::nothrow) CPrivateAirplaneMgr();
if (g_privateAirplaneItems != nullptr) {
if (g_privateAirplaneItems->m_initialized) {
if (CPrivateAirplaneMgr::Init()) {
return true;
}
}
delete g_privateAirplaneItems;
g_privateAirplaneItems = nullptr;
if (g_privateAirplaneItems == nullptr) {
return false;
}
return false;
if (!g_privateAirplaneItems->m_initialized) {
delete g_privateAirplaneItems;
g_privateAirplaneItems = nullptr;
return false;
}
if (!CPrivateAirplaneMgr::Init()) {
delete g_privateAirplaneItems;
g_privateAirplaneItems = nullptr;
return false;
}
return true;
}
// OFFSET: 0x006D0620

View file

@ -20,7 +20,9 @@ public:
/* 0010 */ std::set<std::string> m_endableMaps;
/* 0018 */ std::set<int> m_needItems;
CPrivateAirplaneMgr() : m_initialized(true) {}
CPrivateAirplaneMgr() {
this->m_initialized = true;
}
virtual ~CPrivateAirplaneMgr() = default;
int GetNeedItem(int index);