Skip to content

Commit

Permalink
Fixed random crashes!
Browse files Browse the repository at this point in the history
  • Loading branch information
ds-sloth committed May 14, 2021
1 parent ebe5f31 commit 73c5cf3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
12 changes: 3 additions & 9 deletions source/game_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@ int GameMain(const CmdLineSetup_t &setup)

StartMusic(0);
SetupPlayers();
// printf("How are we doing now???");

For(A, 1, numPlayers)
{
Expand Down Expand Up @@ -491,26 +490,23 @@ int GameMain(const CmdLineSetup_t &setup)
p.Dead = true;
}

// printf("Um, now?");

ProcEvent(LevelStart, true);
For(A, 2, maxEvents)
{
if(Events[A].AutoStart)
ProcEvent(Events[A].Name, true);
}

// printf("Merp?");
overTime = 0;
GoalTime = SDL_GetTicks() + 1000;
fpsCount = 0;
fpsTime = 0;
cycleCount = 0;
gameTime = 0;

// printf("Merp??");
// Update graphics before loop begin (to process inital lazy-unpacking of used sprites)
UpdateGraphics(true);
frmMain.clearBuffer();

// printf("Merp!!!");
do
Expand Down Expand Up @@ -652,9 +648,8 @@ int GameMain(const CmdLineSetup_t &setup)
GoToLevelNoGameThing = false;

// Update graphics before loop begin (to process inital lazy-unpacking of used sprites)
printf("First gfx2\n");
UpdateGraphics2(true);
printf("done!\n");
frmMain.clearBuffer();

do // 'level select loop
{
Expand Down Expand Up @@ -833,9 +828,8 @@ int GameMain(const CmdLineSetup_t &setup)
gameTime = 0;

// Update graphics before loop begin (to process inital lazy-unpacking of used sprites)
printf("Graphics??\n");
UpdateGraphics(true);
printf("entering main game!\n");
frmMain.clearBuffer();

do // MAIN GAME LOOP
{
Expand Down
3 changes: 2 additions & 1 deletion source/npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2635,7 +2635,8 @@ void SpecialNPC(int A)
tempLocation.X = Player[B].Location.X - tempLocation.Width + 4;
if(CheckCollision(NPC[A].Location, tempLocation))
{
UpdateGraphics(true);
// weird case...
// UpdateGraphics(true);
PlaySound(85);
if(NPC[A].Type == 133)
NPC[A].Killed = 3;
Expand Down
3 changes: 2 additions & 1 deletion source/npc/npc_hit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1713,7 +1713,8 @@ void NPCHit(int A, int B, int C)
}
else if(B == 10)
{
UpdateGraphics(true);
// weird case
// UpdateGraphics(true);
NPC[A].Immune = 10;
NPC[A].Damage = NPC[A].Damage + 1;
PlaySound(39);
Expand Down
3 changes: 2 additions & 1 deletion source/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,8 @@ void TailSwipe(int plr, bool boo, bool Stab, int StabDir)
PlaySound(3);
// if(nPlay.Online == true && plr - 1 == nPlay.MySlot)
// Netplay::sendData Netplay::PutPlayerLoc(nPlay.MySlot) + "1g" + std::to_string(plr) + "|" + Player[plr].TailCount - 1;
UpdateGraphics(true);
// weird case...
// UpdateGraphics(true);
if(StabDir == 2)
{
BlockHit(A, true, plr);
Expand Down

0 comments on commit 73c5cf3

Please sign in to comment.