Skip to content

Commit

Permalink
/dbg frag
Browse files Browse the repository at this point in the history
output all the checksum info to help debug frags
  • Loading branch information
tra committed Jun 25, 2024
1 parent 28dcdad commit d47d601
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/game/CAbstractPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ void CAbstractPlayer::FrameAction() {
}

// if a frag frame is specified with /dbg, force a frag on that frame by messing with FRandSeed
int fragFrame = Debug::GetValue("frag");
int fragFrame = Debug::GetValue("ffrag");
if (fragFrame > 0 && itsGame->frameNumber == fragFrame) {
extern Fixed FRandSeed; // to intentionally cause frags below
FRandSeed += 1;
Expand Down
4 changes: 3 additions & 1 deletion src/game/CGlowActors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "CGlowActors.h"

#include "CSmartPart.h"
#include "Debug.h"

extern Fixed FRandSeed;

Expand Down Expand Up @@ -74,5 +75,6 @@ void CGlowActors::FrameAction() {
locsum = location[0] + location[1] + location[2];
UpdateFRandSeed(locsum);
}
// SDL_Log("fn = %u, FRandSeed = %10d, locsum = %8d, Actor = %s", gCurrentGame->frameNumber, (Fixed)FRandSeed, locsum, typeid(*this).name());
DBG_Log("frag", "fn=%u, FRandSeed=%11d, locsum=%8d, Actor=%s",
gCurrentGame->frameNumber, (Fixed)FRandSeed, locsum, typeid(*this).name());
}
6 changes: 4 additions & 2 deletions src/game/CGoody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "CWallActor.h"
#include "GoodyRecord.h"
#include "Preferences.h"
#include "Debug.h"

#define kGoodySound 250

Expand Down Expand Up @@ -202,6 +203,7 @@ void CGoody::FrameAction() {
// the goody heading can make a difference in determing a collision with a Hector
// FRandSeed += heading;
UpdateFRandSeed((uint32_t)heading);
// SDL_Log("fn = %d, goody=%ld: heading = %8d, FRandSeed = %10d, grenades=%d, missiles=%d\n",
// itsGame->frameNumber, ident, heading, (Fixed)FRandSeed, grenades, missiles);
DBG_Log("frag", "fn=%d, FRandSeed=%11d, heading=%7d, goody=%ld, grenades=%d, missiles=%d\n",

itsGame->frameNumber, (Fixed)FRandSeed, heading, ident, grenades, missiles);
}

0 comments on commit d47d601

Please sign in to comment.