Browse files

Merge branch 'bugfixes' into 3.1

  • Loading branch information...
2 parents 7523dbb + fe98143 commit 3ff86896d1304f5163e4744880cd21c106efb7e8 @Cyp Cyp committed Oct 1, 2012
Showing with 11 additions and 9 deletions.
  1. +1 −0 src/fpath.cpp
  2. +2 −2 src/multiint.cpp
  3. +1 −1 tests/maptest.cpp
  4. +4 −3 tests/modeltest.c
  5. +1 −1 tests/qtscripttest.cpp
  6. +2 −2 tools/map/mapload.cpp
View
1 src/fpath.cpp
@@ -653,6 +653,7 @@ void fpathTest(int x, int y, int x2, int y2)
}
//assert(pathJobs.empty()); // can now be marked .deleted as well
assert(pathResults.empty());
+ (void)r; // Squelch unused-but-set warning.
}
bool fpathCheck(Position orig, Position dest, PROPULSION_TYPE propulsion)
View
4 src/multiint.cpp
@@ -2043,7 +2043,7 @@ static bool changePosition(UBYTE player, UBYTE position)
debug(LOG_ERROR, "Failed to swap positions for player %d, position %d", (int)player, (int)position);
if (player < game.maxPlayers && position < game.maxPlayers)
{
- debug(LOG_NET, "corrupted positions :player (%hhu) new position (%hhu) old position (%d)", player, position, NetPlay.players[player].position );
+ debug(LOG_NET, "corrupted positions: player (%u) new position (%u) old position (%d)", player, position, NetPlay.players[player].position);
// Positions were corrupted. Attempt to fix.
NetPlay.players[player].position = position;
NETBroadcastPlayerInfo(player);
@@ -2089,7 +2089,7 @@ bool changeColour(unsigned player, int col, bool isHost)
if (player < game.maxPlayers && col < MAX_PLAYERS)
{
// Colours were corrupted. Attempt to fix.
- debug(LOG_NET, "corrupted colors :player (%hhu) new position (%hhu) old color (%d)", player, col, NetPlay.players[player].colour );
+ debug(LOG_NET, "corrupted colours: player (%u) new colour (%u) old colour (%d)", player, col, NetPlay.players[player].colour);
setPlayerColour(player, col);
NetPlay.players[player].colour = col;
NETBroadcastPlayerInfo(player);
View
2 tests/maptest.cpp
@@ -24,7 +24,7 @@ int main(int argc, char **argv)
GAMEMAP *map;
char filename[PATH_MAX], *delim;
- fscanf(fp, "%s\n", &filename);
+ fscanf(fp, "%256s\n", filename);
// Strip "/game.map"
delim = strrchr(filename, '/');
View
7 tests/modeltest.c
@@ -25,6 +25,7 @@
#include <errno.h>
#include <stdint.h>
#include <stdbool.h>
+#include <unistd.h>
#ifndef WIN32
#include <stdbool.h>
@@ -124,7 +125,7 @@ static void check_pie(const char *input)
for (j = 0; j < points; j++)
{
double a, b, c;
- num = fscanf(fp, "%f %f %f\n", &a, &b, &c);
+ num = fscanf(fp, "%lf %lf %lf\n", &a, &b, &c);
if (num != 3)
{
fprintf(stderr, "File %s. Bad POINTS entry level %d, number %d.\n", input, level, j);
@@ -198,7 +199,7 @@ static void check_pie(const char *input)
for (k = 0; k < 3; k++)
{
double t, u;
- num = fscanf(fp, "%f %f", &t, &u);
+ num = fscanf(fp, "%lf %lf", &t, &u);
if (num != 2)
{
fprintf(stderr, "File %s. Bad texture coordinate entry level %d, number %d\n", input, level, j);
@@ -244,7 +245,7 @@ int main(int argc, char **argv)
{
char filename[PATH_MAX];
- fscanf(fp, "%s\n", &filename);
+ fscanf(fp, "%256s\n", filename);
printf("Testing model: %s\n", filename);
strcpy(fullpath, datapath);
strcat(fullpath, filename);
View
2 tests/qtscripttest.cpp
@@ -21,7 +21,7 @@ int main(int argc, char **argv)
while (!feof(fp))
{
- fscanf(fp, "%s\n", &filename);
+ fscanf(fp, "%256s\n", filename);
printf("Testing script: %s\n", filename);
strcpy(fullpath, datapath);
strcat(fullpath, filename);
View
4 tools/map/mapload.cpp
@@ -316,9 +316,9 @@ GAMEMAP *mapLoad(char *filename)
}
else
{
- debug(LOG_ERROR, "Unknown terrain signature in %s: %hu %hu %hu", path,
+ debug(LOG_INFO, "Unknown terrain signature in %s: %hu %hu %hu", path,
terrainTypes[0], terrainTypes[1], terrainTypes[2]);
- goto failure;
+ map->tileset = TILESET_ARIZONA; // Set something random. Why just have 3 tilesets, anyway?
}
PHYSFS_close(fp);

0 comments on commit 3ff8689

Please sign in to comment.