Decompile fn_21249 (sub_CCFF10)

Batch #7051 by Landruca: 0 byte-identical, 1 confirmed by peer review.

- fn_21249 sub_CCFF10: logic confirmed by peer review

Peer-reviewed-by: eAthena, aDw
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-10-31 03:37:20 +00:00
commit 95aec81042
3 changed files with 28 additions and 0 deletions

View file

@ -438,4 +438,6 @@ static_assert(offsetof(CGameMode, unknown_0628) == 0x628);
static_assert(sizeof(CGameMode) == 0x670);
#endif
extern int g_whisperRecord;
#endif

View file

@ -1,4 +1,6 @@
#include "Client/Mode/CGameMode.h"
#include "Client/Session.h"
#include "File/File.h"
#include "Contents/Actors/Pc.h"
#include "Contents/Ground/TerrainHeight.h"
#include "Contents/World/World.h"
@ -18,6 +20,7 @@
#include "Utility/Math/AffineMatrix.h"
#include "Utility/Text/FormatString.h"
#include <cstdio>
#include <timeapi.h>
#include <windows.h>
@ -26,11 +29,28 @@ int g_searchStoreX;
// GLOBAL: gl_24935
int g_searchStoreY;
// GLOBAL: gl_25107
CFile g_whisperFile;
// OFFSET: 0x00CCFCE0
// FUNCTION: fn_21246
void MiniMapNoOp() {
}
// OFFSET: 0x00CCFF10
// FUNCTION: fn_21249
void sub_CCFF10() {
if (g_whisperRecord != 0) {
if (g_session.IsAdminSubMode(7) != 0) {
char path[256];
char backup[256];
std::sprintf(path, "%s", g_whisperFile.Path());
std::sprintf(backup, "%s.bak", path);
g_whisperFile.Close();
}
}
}
// OFFSET: 0x00CCFFA0
// FUNCTION: fn_21250
void CGameMode::StepTowardWalkableCell(const int& targetX, const int& targetY, int& x, int& y) {

View file

@ -35,6 +35,10 @@ public:
void* GetData() const {
return this->m_data;
}
// INLINED
const char* Path() const {
return this->m_path.c_str();
}
bool Write(const void* data, std::uint32_t bytes);
bool Read(void* data, std::uint32_t bytes);
bool Peek(void* data, std::uint32_t bytes);
@ -55,4 +59,6 @@ protected:
static_assert(sizeof(CFile) == 44);
#endif
extern CFile g_whisperFile;
#endif