Skip to content

Commit a9f1cb3

Browse files
committed
refactor: use engine function for time
1 parent 227853c commit a9f1cb3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Features/Demo/NetworkGhostPlayer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static void startNetDump() {
315315
g_dumpFile = fopen("ghost_net_dump.csv", "w");
316316
if (g_dumpFile) {
317317
fputs("Time,Type,Info\n", g_dumpFile);
318-
g_dumpBaseTime = engine->engineTool->Original<float(__rescall *)(void *thisptr)>(Offsets::HostTick - 1)(engine->engineTool->ThisPtr());
318+
g_dumpBaseTime = engine->GetHostTime();
319319
}
320320
}
321321

@@ -327,7 +327,7 @@ static void endNetDump() {
327327

328328
static void addToNetDump(const char *type, const char *info) {
329329
if (!g_dumpFile) return;
330-
float time = engine->engineTool->Original<float(__rescall *)(void *thisptr)>(Offsets::HostTick - 1)(engine->engineTool->ThisPtr()) - g_dumpBaseTime;
330+
float time = engine->GetHostTime() - g_dumpBaseTime;
331331
fprintf(g_dumpFile, "%.2f,%s,%s\n", time, type, info ? info : "");
332332
}
333333

0 commit comments

Comments
 (0)