Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.
Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
This commit is contained in:
parent
35d2a8cb36
commit
a47d20f8be
890 changed files with 11796 additions and 16664 deletions
|
|
@ -1,60 +0,0 @@
|
|||
#include "Contents/SkillInfo.h"
|
||||
#include "Contents/SkillLevelRegistry.h"
|
||||
#include "Script/LuaScript.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <windows.h>
|
||||
|
||||
// OFFSET: 0x00A92370
|
||||
// FUNCTION: fn_17177
|
||||
void SkillLevelRegistry::Load() {
|
||||
char key[512];
|
||||
std::strcpy(key, this->baseKey);
|
||||
std::strcat(key, "\\SkillUseLevelInfo");
|
||||
HKEY handle;
|
||||
|
||||
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, key, 0, KEY_QUERY_VALUE, &handle) != ERROR_SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
RegCloseKey(handle);
|
||||
|
||||
if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, key, 0, KEY_QUERY_VALUE, &handle) != ERROR_SUCCESS) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto read = [&](int id) {
|
||||
DWORD type = REG_DWORD;
|
||||
DWORD size = sizeof(int);
|
||||
int value;
|
||||
char name[100] = {};
|
||||
const int character = this->character;
|
||||
const char* skill = CSkillInfo::IdName(this->script, id);
|
||||
std::sprintf(name, "%s%d", skill, character);
|
||||
|
||||
if (
|
||||
RegQueryValueExA(handle, name, nullptr, &type, reinterpret_cast<BYTE*>(&value), &size) != ERROR_SUCCESS ||
|
||||
!CSkillInfo::UsesLevel(this->script, id)
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return value;
|
||||
};
|
||||
|
||||
for (int id = 1; id < 7999; ++id) {
|
||||
this->useLevels[id] = read(id);
|
||||
}
|
||||
|
||||
for (int id = 8000; id < 8061; ++id) {
|
||||
this->homunculusLevels[id - 8000] = read(id);
|
||||
}
|
||||
|
||||
for (int id = 8200; id < 8458; ++id) {
|
||||
this->otherLevels[id - 8200] = read(id);
|
||||
}
|
||||
|
||||
RegCloseKey(handle);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue