Skip to content

Commit

Permalink
Misc cean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Apr 20, 2010
1 parent aa83146 commit 6653380
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 20 deletions.
14 changes: 7 additions & 7 deletions doomsday/plugins/common/src/g_game.c
Expand Up @@ -988,18 +988,18 @@ boolean G_Responder(event_t *ev)
if(FI_Responder(ev))
return true;

// Try the chatmode responder.
if(Chat_Responder(ev))
return true;

#if __JDOOM__ || __JHERETIC__ || __JHEXEN__
// Check for cheats?
if(G_GetGameState() == GS_MAP)
{
// Try the chatmode responder.
if(Chat_Responder(ev))
return true;

#if __JDOOM__ || __JHERETIC__ || __JHEXEN__
// Check for cheats.
if(G_EventSequenceResponder(ev))
return true;
}
#endif
}
}

// Try the edit responder.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/hu_log.c
Expand Up @@ -783,7 +783,7 @@ boolean Chat_Responder(event_t* ev)
boolean eatkey = false;
unsigned char c;

if(!chatOn || G_GetGameState() != GS_MAP)
if(!chatOn)
return false;

if(ev->type != EV_KEY)
Expand Down
13 changes: 8 additions & 5 deletions doomsday/plugins/common/src/hu_menu.c
Expand Up @@ -3739,20 +3739,23 @@ void M_LoadGame(int option, void* context)
*/
void M_SaveGame(int option, void* context)
{
player_t* player = &players[CONSOLEPLAYER];
player_t* player = &players[CONSOLEPLAYER];

if(player->playerState == PST_DEAD || Get(DD_PLAYBACK))
{
Hu_MsgStart(MSG_ANYKEY, SAVEDEAD, NULL, NULL);
if(Get(DD_PLAYBACK))
return;
}

if(G_GetGameState() != GS_MAP)
{
Hu_MsgStart(MSG_ANYKEY, SAVEOUTMAP, NULL, NULL);
return;
}

if(player->playerState == PST_DEAD)
{
Hu_MsgStart(MSG_ANYKEY, SAVEDEAD, NULL, NULL);
return;
}

if(IS_CLIENT)
{
#if __JDOOM__ || __JDOOM64__
Expand Down
7 changes: 5 additions & 2 deletions doomsday/plugins/common/src/p_player.c
Expand Up @@ -1108,9 +1108,12 @@ DEFCC(CCmdMakeLocal)
*/
DEFCC(CCmdPrintPlayerCoords)
{
mobj_t *mo = players[CONSOLEPLAYER].plr->mo;
mobj_t* mo;

if(G_GetGameState() != GS_MAP)
return false;

if(!mo || G_GetGameState() != GS_MAP)
if(!(mo = players[CONSOLEPLAYER].plr->mo))
return false;

Con_Printf("Console %i: X=%g Y=%g Z=%g\n", CONSOLEPLAYER,
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jhexen/include/st_stuff.h
Expand Up @@ -57,7 +57,7 @@ void ST_updateGraphics(void);
void ST_HUDUnHide(int player, hueevent_t ev);

// Called in P_inter & P_enemy
void ST_doPaletteStuff(int player, boolean forceChange);
void ST_doPaletteStuff(int player);

void ST_Init(void);
boolean ST_Responder(event_t* ev);
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jhexen/src/p_enemy.c
Expand Up @@ -4183,7 +4183,7 @@ void C_DECL A_FreezeDeath(mobj_t* mo)
plr->poisonCount = 0;
plr->bonusCount = 0;

ST_doPaletteStuff(plr - players, false);
ST_doPaletteStuff(plr - players);
}
else if(mo->flags & MF_COUNTKILL && mo->special)
{ // Initiate monster death actions.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jhexen/src/p_inter.c
Expand Up @@ -2192,7 +2192,7 @@ int P_DamageMobj(mobj_t* target, mobj_t* inflictor, mobj_t* source,
// Maybe unhide the HUD?
ST_HUDUnHide(player - players, HUE_ON_DAMAGE);

ST_doPaletteStuff(player - players, false);
ST_doPaletteStuff(player - players);
}

// How about some particles, yes?
Expand Down
4 changes: 2 additions & 2 deletions doomsday/plugins/jhexen/src/st_stuff.c
Expand Up @@ -1185,7 +1185,7 @@ void ST_Ticker(void)
* Sets the new palette based upon the current values of
* player_t->damageCount and player_t->bonusCount.
*/
void ST_doPaletteStuff(int player, boolean forceChange)
void ST_doPaletteStuff(int player)
{
int palette = 0;
player_t* plr;
Expand Down Expand Up @@ -1668,7 +1668,7 @@ void ST_Drawer(int player, int fullscreenmode, boolean refresh)
(cfg.automapHudDisplay == 0 || cfg.automapHudDisplay == 2));

// Do palette shifts
ST_doPaletteStuff(player, false);
ST_doPaletteStuff(player);

// Either slide the status bar in or fade out the fullscreen hud
if(hud->statusbarActive)
Expand Down

0 comments on commit 6653380

Please sign in to comment.