#pragma once #include #include namespace dnf90_expert_job { // Current EXE 03A4C1A0 returns actor+18. Mode3 writes state+34C for // personal info, but menu action4 / 00FF1FF0 reads state+368 instead. constexpr size_t kPersonalInfoTypeOffset = 0x364; constexpr size_t kFunctionTypeOffset = 0x380; struct PreviousTypes { uint32_t personalInfo; uint32_t function; }; // The caller resolves the native current actor, validates the server op205 // type, and retains its existing SEH/actor identity boundary. This helper // only mirrors that exact type; it does not grant or persist a profession. inline bool MirrorType(void* actor, uint32_t type, PreviousTypes& previous) { if (!actor || type > 4) return false; unsigned char* bytes = static_cast(actor); memcpy(&previous.personalInfo, bytes + kPersonalInfoTypeOffset, sizeof(type)); memcpy(&previous.function, bytes + kFunctionTypeOffset, sizeof(type)); memcpy(bytes + kPersonalInfoTypeOffset, &type, sizeof(type)); memcpy(bytes + kFunctionTypeOffset, &type, sizeof(type)); return true; } }