Skip to content

Commit

Permalink
Fixed BUG #1548165 - when a par time is not specified via a MapInfo d…
Browse files Browse the repository at this point in the history
…efinition the time would be displayed as 00:05. As this is a rather unrealistic goal, par time is now hidden completely if not specified.
  • Loading branch information
danij committed Sep 2, 2006
1 parent e42c010 commit 16d156f
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 28 deletions.
1 change: 1 addition & 0 deletions doomsday/engine/portable/src/def_data.c
Expand Up @@ -329,6 +329,7 @@ int DED_AddMapInfo(ded_t * ded, char *str)
strcpy(inf->id, str);
inf->gravity = 1;
inf->sky_height = .666667f;
inf->partime = -1; // unknown

for(i = 0; i < NUM_SKY_MODELS; i++)
{
Expand Down
2 changes: 2 additions & 0 deletions doomsday/plugins/common/src/g_game.c
Expand Up @@ -1625,6 +1625,8 @@ void G_PrepareWIData(void)
// See if there is a par time definition.
if(Def_Get(DD_DEF_MAP_INFO, levid, &minfo) && minfo.partime > 0)
wminfo.partime = 35 * (int) minfo.partime;
else
wminfo.partime = -1; // unknown

wminfo.pnum = consoleplayer;
for(i = 0; i < MAXPLAYERS; i++)
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/p_mapsetup.c
Expand Up @@ -363,7 +363,7 @@ static void P_ResetWorldState(void)

#if __JDOOM__
wminfo.maxfrags = 0;
wminfo.partime = 180;
wminfo.partime = -1;

// Only used with 666/7 specials
bossKilled = false;
Expand Down
24 changes: 15 additions & 9 deletions doomsday/plugins/doom64tc/src/wi_stuff.c
Expand Up @@ -976,7 +976,8 @@ void WI_updateStats(void)
cnt_items[0] = (plrs[me].sitems * 100) / wbs->maxitems;
cnt_secret[0] = (plrs[me].ssecret * 100) / wbs->maxsecret;
cnt_time = plrs[me].stime / TICRATE;
cnt_par = wbs->partime / TICRATE;
if(cnt_par != -1)
cnt_par = wbs->partime / TICRATE;
S_LocalSound(sfx_barexp, 0);
sp_state = 10;
}
Expand Down Expand Up @@ -1034,18 +1035,23 @@ void WI_updateStats(void)
if(cnt_time >= plrs[me].stime / TICRATE)
cnt_time = plrs[me].stime / TICRATE;

cnt_par += 3;

if(cnt_par >= wbs->partime / TICRATE)
if(cnt_par != -1)
{
cnt_par = wbs->partime / TICRATE;
cnt_par += 3;

if(cnt_time >= plrs[me].stime / TICRATE)
if(cnt_par >= wbs->partime / TICRATE)
{
S_LocalSound(sfx_barexp, 0);
sp_state++;
cnt_par = wbs->partime / TICRATE;

if(cnt_time >= plrs[me].stime / TICRATE)
{
S_LocalSound(sfx_barexp, 0);
sp_state++;
}
}
}
else
sp_state++;
}
else if(sp_state == 10)
{
Expand Down Expand Up @@ -1095,7 +1101,7 @@ void WI_drawStats(void)
ALIGN_LEFT);
WI_drawTime(SCREENWIDTH / 2 - SP_TIMEX, SP_TIMEY, cnt_time);

if(wbs->epsd < 3)
if(wbs->epsd < 3 && cnt_par != -1)
{
WI_DrawPatch(SCREENWIDTH / 2 + SP_TIMEX, SP_TIMEY, 1, 1, 1, 1, par.lump,
NULL, false, ALIGN_LEFT);
Expand Down
24 changes: 15 additions & 9 deletions doomsday/plugins/jdoom/src/wi_stuff.c
Expand Up @@ -1260,7 +1260,8 @@ void WI_updateStats(void)
cnt_items[0] = (plrs[me].sitems * 100) / wbs->maxitems;
cnt_secret[0] = (plrs[me].ssecret * 100) / wbs->maxsecret;
cnt_time = plrs[me].stime / TICRATE;
cnt_par = wbs->partime / TICRATE;
if(cnt_par != -1)
cnt_par = wbs->partime / TICRATE;
S_LocalSound(sfx_barexp, 0);
sp_state = 10;
}
Expand Down Expand Up @@ -1318,18 +1319,23 @@ void WI_updateStats(void)
if(cnt_time >= plrs[me].stime / TICRATE)
cnt_time = plrs[me].stime / TICRATE;

cnt_par += 3;

if(cnt_par >= wbs->partime / TICRATE)
if(cnt_par != -1)
{
cnt_par = wbs->partime / TICRATE;
cnt_par += 3;

if(cnt_time >= plrs[me].stime / TICRATE)
if(cnt_par >= wbs->partime / TICRATE)
{
S_LocalSound(sfx_barexp, 0);
sp_state++;
cnt_par = wbs->partime / TICRATE;

if(cnt_time >= plrs[me].stime / TICRATE)
{
S_LocalSound(sfx_barexp, 0);
sp_state++;
}
}
}
else
sp_state++;
}
else if(sp_state == 10)
{
Expand Down Expand Up @@ -1383,7 +1389,7 @@ void WI_drawStats(void)
ALIGN_LEFT);
WI_drawTime(SCREENWIDTH / 2 - SP_TIMEX, SP_TIMEY, cnt_time);

if(wbs->epsd < 3)
if(wbs->epsd < 3 && cnt_par != -1)
{
WI_DrawPatch(SCREENWIDTH / 2 + SP_TIMEX, SP_TIMEY, 1, 1, 1, 1, par.lump,
NULL, false, ALIGN_LEFT);
Expand Down
24 changes: 15 additions & 9 deletions doomsday/plugins/wolftc/src/wi_stuff.c
Expand Up @@ -1268,7 +1268,8 @@ void WI_updateStats(void)
cnt_items[0] = (plrs[me].sitems * 100) / wbs->maxitems;
cnt_secret[0] = (plrs[me].ssecret * 100) / wbs->maxsecret;
cnt_time = plrs[me].stime / TICRATE;
cnt_par = wbs->partime / TICRATE;
if(cnt_par != -1)
cnt_par = wbs->partime / TICRATE;
S_LocalSound(sfx_intcmp, 0);
sp_state = 10;
}
Expand Down Expand Up @@ -1326,18 +1327,23 @@ void WI_updateStats(void)
if(cnt_time >= plrs[me].stime / TICRATE)
cnt_time = plrs[me].stime / TICRATE;

cnt_par += 3;

if(cnt_par >= wbs->partime / TICRATE)
if(cnt_par != -1)
{
cnt_par = wbs->partime / TICRATE;
cnt_par += 3;

if(cnt_time >= plrs[me].stime / TICRATE)
if(cnt_par >= wbs->partime / TICRATE)
{
S_LocalSound(sfx_intcmp, 0);
sp_state++;
cnt_par = wbs->partime / TICRATE;

if(cnt_time >= plrs[me].stime / TICRATE)
{
S_LocalSound(sfx_intcmp, 0);
sp_state++;
}
}
}
else
sp_state++;
}
else if(sp_state == 10)
{
Expand Down Expand Up @@ -1391,7 +1397,7 @@ void WI_drawStats(void)
ALIGN_LEFT);
WI_drawTime(SCREENWIDTH / 2 - SP_TIMEX, SP_TIMEY, cnt_time);

if(wbs->epsd < 3)
if(wbs->epsd < 3 && cnt_par != -1)
{
WI_DrawPatch(SCREENWIDTH / 2 + SP_TIMEX, SP_TIMEY, 1, 1, 1, 1, par.lump,
NULL, false, ALIGN_LEFT);
Expand Down

0 comments on commit 16d156f

Please sign in to comment.