Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 184f5dc

Browse files
committed
[[ Cleanup ]] MCWait::parse(): Reformat if statements for greater clarity.
Makes the code easier to read *and* silences some warnings!
1 parent e276e26 commit 184f5dc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

engine/src/cmds.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,17 +2475,17 @@ Parse_stat MCWait::parse(MCScriptPoint &sp)
24752475
return PS_ERROR;
24762476
}
24772477
if (condition == RF_FOR)
2478+
{
24782479
if (sp.skip_token(SP_FACTOR, TT_FUNCTION, F_MILLISECS) == PS_NORMAL)
24792480
units = F_MILLISECS;
2481+
else if (sp.skip_token(SP_FACTOR, TT_FUNCTION, F_SECONDS) == PS_NORMAL
2482+
|| sp.skip_token(SP_FACTOR, TT_CHUNK, CT_SECOND) == PS_NORMAL)
2483+
units = F_SECONDS;
2484+
else if (sp.skip_token(SP_FACTOR, TT_FUNCTION, F_TICKS) == PS_NORMAL)
2485+
units = F_TICKS;
24802486
else
2481-
if (sp.skip_token(SP_FACTOR, TT_FUNCTION, F_SECONDS) == PS_NORMAL
2482-
|| sp.skip_token(SP_FACTOR, TT_CHUNK, CT_SECOND) == PS_NORMAL)
2483-
units = F_SECONDS;
2484-
else
2485-
if (sp.skip_token(SP_FACTOR, TT_FUNCTION, F_TICKS) == PS_NORMAL)
2486-
units = F_TICKS;
2487-
else
2488-
units = F_TICKS;
2487+
units = F_TICKS;
2488+
}
24892489
if (sp.skip_token(SP_REPEAT, TT_UNDEFINED, RF_WITH) == PS_NORMAL)
24902490
{
24912491
sp.skip_token(SP_MOVE, TT_UNDEFINED, MM_MESSAGES);

0 commit comments

Comments
 (0)