Decompile 7 functions in Source/Contents/MapSkyMgr.cpp, Source/Contents/MapSkyMgr.h, ...
Batch #1447 by Yommy: 0 byte-identical, 7 confirmed by peer review. - fn_03435 CMapSkyMgr::LoadData: logic confirmed by peer review - fn_23794 CSession::GetAccessoryName: logic confirmed by peer review - fn_17667 WorldActors::Lookup: logic confirmed by peer review - fn_17698 WorldObjects::SendObjectMessage: logic confirmed by peer review - fn_17865 CPathFinder::~CPathFinder: logic confirmed by peer review - fn_18334 LuaScript::TableField: logic confirmed by peer review - fn_07925 CImfRes::Load: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker Reviewed-by: ragnarok-clanker
This commit is contained in:
parent
07472c7abc
commit
73cc345898
6 changed files with 139 additions and 0 deletions
|
|
@ -3,3 +3,10 @@
|
|||
#include <string>
|
||||
|
||||
// OFFSET: 0x00E0A2C0
|
||||
// FUNCTION: fn_23794
|
||||
std::string CSession::GetAccessoryName(int id) {
|
||||
if (id < 0 || static_cast<unsigned int>(id) >= this->m_accessoryNames.size()) {
|
||||
return "_병아리모자";
|
||||
}
|
||||
return this->m_accessoryNames[id];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
#include "Contents/MapSkyMgr.h"
|
||||
|
||||
// OFFSET: 0x005B8F00
|
||||
// FUNCTION: fn_03435
|
||||
bool CMapSkyMgr::LoadData() {
|
||||
return this->m_script->Load("Lua Files\\MapSkyData\\MapSkyData", true, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,17 @@
|
|||
#include "Resource/World/TerrainResource.h"
|
||||
|
||||
// OFFSET: 0x00AD85A0
|
||||
// FUNCTION: fn_17865
|
||||
CPathFinder::~CPathFinder() {
|
||||
this->nodePool.clear();
|
||||
this->Reset();
|
||||
|
||||
for (auto& [name, cached] : this->attrCache) {
|
||||
delete cached;
|
||||
}
|
||||
|
||||
this->attrCache.clear();
|
||||
}
|
||||
|
||||
// OFFSET: 0x00AD8DB0
|
||||
// FUNCTION: fn_17872
|
||||
|
|
|
|||
|
|
@ -3,6 +3,20 @@
|
|||
#include "Contents/World/WorldObjects.h"
|
||||
|
||||
// OFFSET: 0x00AC8220
|
||||
// FUNCTION: fn_17667
|
||||
CRenderObject* WorldActors::Lookup(std::uint32_t accountId) const {
|
||||
if (accountId == this->localAccountId) {
|
||||
return this->localPlayer;
|
||||
}
|
||||
|
||||
for (CRenderObject* actor : this->actors) {
|
||||
if (actor->render.accountId == accountId) {
|
||||
return actor;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00ACA4E0
|
||||
// FUNCTION: fn_17692
|
||||
|
|
@ -27,3 +41,20 @@ void WorldObjects::Clear() {
|
|||
}
|
||||
|
||||
// OFFSET: 0x00ACA980
|
||||
// FUNCTION: fn_17698
|
||||
void WorldObjects::SendObjectMessage(CGameObject* sender, std::uint64_t identity, int message, int a, int b, int c, int d) {
|
||||
if (this == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (identity == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (CRenderObject* object : this->objects) {
|
||||
if (object->identity == identity) {
|
||||
object->SendObjectMessage(sender, message, message >> 31, a, a >> 31, b, b >> 31, c, c >> 31, d, d >> 31, 0, 0, 0, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,3 +2,56 @@
|
|||
#include "File/File.h"
|
||||
|
||||
// OFFSET: 0x0074F190
|
||||
// FUNCTION: fn_07925
|
||||
bool CImfRes::Load(const char* name) {
|
||||
CFile file;
|
||||
float version;
|
||||
|
||||
if (!file.Open(name, 0, true, false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
file.Read(&version, 4);
|
||||
if (!(1.01f <= version)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int checksum;
|
||||
file.Read(&checksum, 4);
|
||||
|
||||
int maxLayer;
|
||||
file.Read(&maxLayer, 4);
|
||||
|
||||
for (int layer = 0; layer <= maxLayer; ++layer) {
|
||||
std::vector<ImfData> actions;
|
||||
|
||||
int numAction;
|
||||
file.Read(&numAction, 4);
|
||||
this->m_maxAction[layer] = numAction;
|
||||
|
||||
for (int action = 0; action < numAction; ++action) {
|
||||
ImfData data;
|
||||
|
||||
int numMotion;
|
||||
file.Read(&numMotion, 4);
|
||||
this->m_maxMotion[layer][action] = numMotion;
|
||||
|
||||
for (int motion = 0; motion < numMotion; ++motion) {
|
||||
int value;
|
||||
file.Read(&value, 4);
|
||||
data.priority.push_back(value);
|
||||
file.Read(&value, 4);
|
||||
data.cx.push_back(value);
|
||||
file.Read(&value, 4);
|
||||
data.cy.push_back(value);
|
||||
}
|
||||
|
||||
actions.push_back(data);
|
||||
}
|
||||
|
||||
this->m_imfData.push_back(actions);
|
||||
}
|
||||
|
||||
file.Close();
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,6 +103,39 @@ void LuaScript::Error(const char* caption, const char* format, ...) {
|
|||
}
|
||||
|
||||
// OFFSET: 0x00AFDC60
|
||||
// FUNCTION: fn_18334
|
||||
bool LuaScript::TableField(const char* signature, ...) {
|
||||
va_list arguments;
|
||||
va_start(arguments, signature);
|
||||
|
||||
if (*signature == 'd') {
|
||||
lua_pushnumber(this->m_state, va_arg(arguments, int));
|
||||
lua_gettable(this->m_state, -2);
|
||||
} else if (*signature == 's') {
|
||||
lua_pushstring(this->m_state, va_arg(arguments, const char*));
|
||||
lua_gettable(this->m_state, -2);
|
||||
}
|
||||
|
||||
++signature;
|
||||
|
||||
if (*signature == 'd' && lua_isnumber(this->m_state, -1)) {
|
||||
*va_arg(arguments, int*) = static_cast<int>(lua_tonumber(this->m_state, -1));
|
||||
lua_pop(this->m_state, 1);
|
||||
}
|
||||
|
||||
if (*signature == 's' && lua_isstring(this->m_state, -1)) {
|
||||
*va_arg(arguments, const char**) = lua_tostring(this->m_state, -1);
|
||||
lua_pop(this->m_state, 1);
|
||||
}
|
||||
|
||||
if (*signature == 'l' && lua_isnumber(this->m_state, -1)) {
|
||||
*va_arg(arguments, double*) = lua_tonumber(this->m_state, -1);
|
||||
lua_pop(this->m_state, 1);
|
||||
}
|
||||
|
||||
va_end(arguments);
|
||||
return true;
|
||||
}
|
||||
|
||||
// OFFSET: 0x00AFC9A0
|
||||
// FUNCTION: fn_18326
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue