summaryrefslogtreecommitdiff
path: root/src/client/GameSave.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-06-05 21:55:39 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-06-05 21:55:39 (GMT)
commit7063587706f1f2d440c501ed67323cf6bfb5c3a3 (patch)
tree4cf12636d4aa0a528cde50deed42e228b86e6b09 /src/client/GameSave.cpp
parent49dafbfd263957631116557ac4fa59429390ebaa (diff)
downloadpowder-7063587706f1f2d440c501ed67323cf6bfb5c3a3.zip
powder-7063587706f1f2d440c501ed67323cf6bfb5c3a3.tar.gz
Fix bmap reading error caused by signed/unsigned comparison
Diffstat (limited to 'src/client/GameSave.cpp')
-rw-r--r--src/client/GameSave.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/client/GameSave.cpp b/src/client/GameSave.cpp
index d2b163e..ed742b0 100644
--- a/src/client/GameSave.cpp
+++ b/src/client/GameSave.cpp
@@ -47,8 +47,8 @@ void GameSave::setSize(int newWidth, int newHeight)
this->height = (newHeight/CELL)*CELL;
particles = new Particle[NPART];
- blockMap = new char*[height/CELL];
- blockMapPtr = new char[(height/CELL)*(width/CELL)];
+ blockMap = new unsigned char*[height/CELL];
+ blockMapPtr = new unsigned char[(height/CELL)*(width/CELL)];
fill(blockMapPtr, blockMapPtr+((height/CELL)*(width/CELL)), 0);
for(int y = 0; y < height/CELL; y++)
blockMap[y] = &blockMapPtr[y*(width/CELL)];
@@ -658,7 +658,6 @@ GameSave::ParseResult GameSave::readPSv(char * data, int dataLength)
p++;
continue;
}
-
blockMap[y][x] = d[p];
if (blockMap[y][x]==1)
blockMap[y][x]=WL_WALL;