Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed|GCC: Signed/unsigned warnings re D_CMD(WarpMap)
  • Loading branch information
danij-deng committed Sep 8, 2012
1 parent c904392 commit e5e1f14
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions doomsday/plugins/common/src/g_game.c
Expand Up @@ -4053,7 +4053,7 @@ D_CMD(ListMaps)

D_CMD(WarpMap)
{
int epsd, map, i;
uint epsd, map, i;

// Only server operators can warp maps in network games.
/// @todo Implement vote or similar mechanics.
Expand All @@ -4066,7 +4066,7 @@ D_CMD(WarpMap)
{
// "warp M":
epsd = 0;
map = atoi(argv[1]);
map = MAX_OF(0, atoi(argv[1]));
}
#endif
#if __JDOOM__
Expand All @@ -4077,20 +4077,20 @@ D_CMD(WarpMap)
{
// "warp EM" or "warp M":
int num = atoi(argv[1]);
epsd = num / 10;
map = num % 10;
epsd = MAX_OF(0, num / 10);
map = MAX_OF(0, num % 10);
}
else // (argc == 3)
{
// "warp E M":
epsd = atoi(argv[1]);
map = atoi(argv[2]);
epsd = MAX_OF(0, atoi(argv[1]));
map = MAX_OF(0, atoi(argv[2]));
}
#endif

// Internally epsiode and map numbers are zero-based.
if(epsd > 0) epsd -= 1;
if(map > 0) map -= 1;
if(epsd != 0) epsd -= 1;
if(map != 0) map -= 1;

// Catch invalid maps.
#if __JHEXEN__
Expand Down

0 comments on commit e5e1f14

Please sign in to comment.