turn players into DObjects and fix several bugs with bad memory access.

* DObjects may not be memset to 0.
* There was still code trying to retrieve the player index with pointer artithmetic. With an array of pointers this does not work.
This commit is contained in:
Christoph Oelckers 2023-10-02 21:03:59 +02:00
parent d60834be3d
commit dd2ea96d6c
125 changed files with 1678 additions and 1558 deletions

View file

@ -101,7 +101,17 @@ static uint64_t stabilityticduration = 0;
static uint64_t stabilitystarttime = 0;
static double inputScale;
CorePlayer* PlayerArray[MAXPLAYERS];
DCorePlayer* PlayerArray[MAXPLAYERS];
IMPLEMENT_CLASS(DCorePlayer, true, true)
IMPLEMENT_POINTERS_START(DCorePlayer)
IMPLEMENT_POINTER(actor)
IMPLEMENT_POINTERS_END
void MarkPlayers()
{
GC::MarkArray(PlayerArray, MAXPLAYERS);
}
bool r_NoInterpolate;
int entertic;