From 6c94f72f1802dddbf9cb0ce6f9939ccd2404bc99 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 11 Nov 2023 21:34:06 +0100 Subject: [PATCH] qwert --- source/common/objects/dobjgc.cpp | 1 - source/common/objects/dobjgc.h | 2 +- source/core/mainloop.cpp | 4 ++-- source/games/duke/src/game.cpp | 7 ++++++- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/source/common/objects/dobjgc.cpp b/source/common/objects/dobjgc.cpp index acb1b9256c..9511558735 100644 --- a/source/common/objects/dobjgc.cpp +++ b/source/common/objects/dobjgc.cpp @@ -107,7 +107,6 @@ // Cost of destroying an object #define GCDESTROYCOST 15 -void DumpThePlayer(); // TYPES ------------------------------------------------------------------- diff --git a/source/common/objects/dobjgc.h b/source/common/objects/dobjgc.h index a0d1af2f3a..5b799a1219 100644 --- a/source/common/objects/dobjgc.h +++ b/source/common/objects/dobjgc.h @@ -322,4 +322,4 @@ namespace GC #define Printmark(p) Printf("%s %d %p\n", __FILE__, __LINE__, p); Printf("---> %s\n", p ? p->GetClass()->TypeName.GetChars() : ""); -void DumpThePlayer(); \ No newline at end of file +void DumpThePlayer(int i = 7); \ No newline at end of file diff --git a/source/core/mainloop.cpp b/source/core/mainloop.cpp index e0351bec0a..b47d5a8f2b 100644 --- a/source/core/mainloop.cpp +++ b/source/core/mainloop.cpp @@ -102,9 +102,9 @@ static uint64_t stabilitystarttime = 0; DCorePlayer* PlayerArray[MAXPLAYERS]; -void DumpThePlayer() +void DumpThePlayer(int pl) { - auto p = PlayerArray[7]; + auto p = PlayerArray[pl]; Printf("%p\n", p); if (!p) return; auto l = p->GetClass()->Size; diff --git a/source/games/duke/src/game.cpp b/source/games/duke/src/game.cpp index 53d8af6770..4287e9e10a 100644 --- a/source/games/duke/src/game.cpp +++ b/source/games/duke/src/game.cpp @@ -411,8 +411,13 @@ void GameInterface::app_init() // Initialise player array. for (unsigned i = 0; i < MAXPLAYERS; i++) { - PlayerArray[i] = Create(i); + auto pl = Create(i); + PlayerArray[i] = pl; + Printf("Player %d\n", i); + DumpThePlayer(i); GC::WriteBarrier(PlayerArray[i]); + Printf("Player %d b\n", i); + DumpThePlayer(i); } DumpThePlayer();