rodecomp/Source/Contents/MapPropertyMgr.cpp
ragnarok-clanker a282559648 Decompile 8 functions in Source/Contents/MapPropertyMgr.cpp, Source/Contents/MapPropertyMgr.h, ...
Batch #3148 by eAthena: 0 byte-identical, 8 confirmed by peer review.

- fn_20970 CMapProperty::CMapProperty: logic confirmed by peer review
- fn_20971 std::pair<int const,CMapProperty>::`scalar deleting destructor': logic confirmed by peer review
- fn_20973 CMapProperty::SetValue: logic confirmed by peer review
- fn_20974 CMapProperty::GetValue: logic confirmed by peer review
- fn_20980 CMapPropertyMgr::Create: logic confirmed by peer review
- fn_20981 CMapPropertyMgr::Destroy: logic confirmed by peer review
- fn_20982 CMapPropertyMgr::GetValue: logic confirmed by peer review
- fn_21078 CRenderObject::ModifyArgb: logic confirmed by peer review (already on main)

Peer-reviewed-by: meitogi
Reviewed-by: ragnarok-clanker
2026-10-29 21:57:16 +00:00

75 lines
1.6 KiB
C++

#include "Contents/MapPropertyMgr.h"
#include <new>
// GLOBAL: gl_24816
CMapPropertyMgr* g_mapPropertyMgr;
// OFFSET: 0x00CA7640
// FUNCTION: fn_20970
CMapProperty::CMapProperty() {
}
// OFFSET: 0x00CA76C0
// FUNCTION: fn_20971
CMapProperty::~CMapProperty() {
}
// OFFSET: 0x00CA7790
// FUNCTION: fn_20973
void CMapProperty::SetValue(int key, int value) {
this->m_values[key] = value;
}
// OFFSET: 0x00CA7880
// FUNCTION: fn_20974
int CMapProperty::GetValue(int key) {
std::map<int, int>::iterator found = this->m_values.find(key);
if (found == this->m_values.end()) {
return 0;
}
return found->second;
}
// OFFSET: 0x00CA7E70
// FUNCTION: fn_20979
void CMapPropertyMgr::Clear() {
if (this != nullptr) {
this->m_properties.clear();
}
}
// OFFSET: 0x00CA7EA0
// FUNCTION: fn_20980
bool CMapPropertyMgr::Create() {
if (g_mapPropertyMgr == nullptr) {
g_mapPropertyMgr = new (std::nothrow) CMapPropertyMgr;
if (g_mapPropertyMgr != nullptr) {
if (g_mapPropertyMgr->m_valid) {
return true;
}
delete g_mapPropertyMgr;
g_mapPropertyMgr = nullptr;
}
}
return false;
}
// OFFSET: 0x00CA7F90
// FUNCTION: fn_20981
void CMapPropertyMgr::Destroy() {
if (g_mapPropertyMgr != nullptr) {
delete g_mapPropertyMgr;
g_mapPropertyMgr = nullptr;
}
}
// OFFSET: 0x00CA7FB0
// FUNCTION: fn_20982
int CMapPropertyMgr::GetValue(int mapId, int key) {
std::map<int, CMapProperty>::iterator found = this->m_properties.find(mapId);
if (found == this->m_properties.end()) {
return 0;
}
return found->second.GetValue(key);
}