
|
|
Author |
Message |
Raziel
DieHard SS

Joined: 03 Dec 2005
Last Visit: 03 Dec 2009
Topics: 49
Posts: 485
Location: Israhell

|
|
 |
BrotherTank
Forum Administrator

Joined: 01 Mar 2003
Last Visit: 13 Sep 2017
Topics: 153
Posts: 2248
Location: Ontario

|
Posted: Wed Jul 16, 2008 11:51 am
Subject: Re: [HELP] Weird Bug
[ IP : Logged ]
|

  
|
|
Which game? Your own source? Need a little more info to go on..???
Greg
BrotherTank |
|
|
 |
Raziel
DieHard SS

Joined: 03 Dec 2005
Last Visit: 03 Dec 2009
Topics: 49
Posts: 485
Location: Israhell

|
|
 |
Zombie_Plan
DieHard Wolfer


Joined: 12 Oct 2004
Last Visit: 5:40 ago.
Topics: 111
Posts: 1757
Location: A hole in the wall

|
Posted: Thu Jul 17, 2008 5:50 am
Subject: Re: [HELP] Weird Bug
[ IP : Logged ]
|

  
|
|
by commenting off that line, whatever line was underneath it will be executed regardless of whether or not tab is pressed I think that's what's going on anyway. |
_________________ WolfSource - Your news source since the beginning of time (2019)
|
|
 |
Raziel
DieHard SS

Joined: 03 Dec 2005
Last Visit: 03 Dec 2009
Topics: 49
Posts: 485
Location: Israhell

|
Posted: Thu Jul 17, 2008 1:29 pm
Subject: Re: [HELP] Weird Bug
[ IP : Logged ]
|

  
|
|
I don't think the last line has anything to do with the game crashing..
those are the last lines after:
::: CODE :::
//
// show screen and time last cycle
//
if (fizzlein)
{
FizzleFade(screenBuffer, screen, 0, 0,
screenWidth, screenHeight, 21, false);
fizzlein = false;
lasttimecount = GetTimeCount(); // don't make a big tic count
}
else
{
#ifndef REMDEBUG
if (fpscounter)
{
fontnumber = 0;
SETFONTCOLOR(7,127);
PrintX=4; PrintY=1;
VWB_Bar(0,0,50,10,bordercol);
US_PrintSigned(fps);
US_Print(" fps");
}
#endif
SDL_BlitSurface(screenBuffer, NULL, screen, NULL);
SDL_UpdateRect(screen, 0, 0, 0, 0);
}
#ifndef REMDEBUG
if (fpscounter)
{
fps_frames++;
fps_time+=tics;
if(fps_time>35)
{
fps_time-=35;
fps=fps_frames<<1;
fps_frames=0;
}
}
#endif
}
I just want to play the FULL SCREEN mode (view size 21) with the HUD :\
can anyone please help out here?
thanks. |
_________________ Raziel A.
|
|
 |
Ripper
Code Master - Developer


Joined: 15 Mar 2003
Last Visit: 30 Sep 2008
Topics: 21
Posts: 527
Location: Germany

|
Posted: Sun Jul 20, 2008 4:24 am
Subject: Re: [HELP] Weird Bug
[ IP : Logged ]
|

  
|
|
When you die the gamestate.weapon is set to -1.
When ShowActStatus() tries to draw that weapon it crashes.
That's why ShowActStatus() is only called when the player is not currently dying (gamestate.weapon != -1).
Your above code
::: CODE :::
// if(Keyboard[sc_Tab] && // WRONG
(viewsize == 21 && gamestate.weapon != -1);
ShowActStatus();
always executes ShowActStatus().
You probably wanted it to be
::: CODE :::
if(viewsize == 21 && gamestate.weapon != -1)
ShowActStatus();
which will only show the floating hud in full size mode and when the player is not dying.
If you want the hud to still be displayed, when the player dies, you have to use
::: CODE :::
if(viewsize == 21)
ShowActStatus();
and the following changes:
::: CODE :::
Index: wl_game.cpp
===================================================================
--- wl_game.cpp (revision 222)
+++ wl_game.cpp (working copy)
@@ -1232,6 +1232,7 @@
VW_FadeIn ();
}
+ gamestate.diedweapon = gamestate.weapon;
gamestate.weapon = (weapontype) -1; // take away weapon
SD_PlaySound (PLAYERDEATHSND);
Index: wl_def.h
===================================================================
--- wl_def.h (revision 222)
+++ wl_def.h (working copy)
@@ -859,7 +859,7 @@
short health;
short ammo;
short keys;
- weapontype bestweapon,weapon,chosenweapon;
+ weapontype bestweapon,weapon,chosenweapon,diedweapon;
short faceframe;
short attackframe,attackcount,weaponframe;
Index: wl_agent.cpp
===================================================================
--- wl_agent.cpp (revision 222)
+++ wl_agent.cpp (working copy)
@@ -570,7 +570,8 @@
void DrawWeapon (void)
{
if(viewsize == 21 && ingame) return;
- StatusDrawPic (32,8,KNIFEPIC+gamestate.weapon);
+ // gamestate.weapon is -1 if the player died. In this case diedweapon has been set to the last weapon.
+ StatusDrawPic (32,8,KNIFEPIC+(gamestate.weapon != -1 ? gamestate.weapon : gamestate.diedweapon));
}
(lines prefixed by a "-" are to be removed, those prefixed by "+" must be added). |
_________________ Life is an awful game, but the graphics resolution rocks ;D
|
|
 |
Raziel
DieHard SS

Joined: 03 Dec 2005
Last Visit: 03 Dec 2009
Topics: 49
Posts: 485
Location: Israhell

|
Posted: Sun Jul 20, 2008 7:22 am
Subject: Re: [HELP] Weird Bug
[ IP : Logged ]
|

 
|
|
Thanks! it helped!! |
_________________ Raziel A.
|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum
|
|
You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group
|