From 8b43f056d79e62a6300842692fa2892bf2d81d6e Mon Sep 17 00:00:00 2001 From: Caldfir Date: Mon, 30 Apr 2012 17:36:03 -0700 Subject: Fixed an erroneous double-multiplication by the size of a cell which was causing some issues elsewhere. --- MapLoading.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/MapLoading.cpp b/MapLoading.cpp index 91e4117..14e945d 100644 --- a/MapLoading.cpp +++ b/MapLoading.cpp @@ -772,22 +772,22 @@ WorldSegment* ReadMapSegment(int x, int y, int z, int sizex, int sizey, int size int cellDimX, cellDimY, cellDimZ; Maps::getSize((unsigned int &)cellDimX, (unsigned int &)cellDimY, (unsigned int &)cellDimZ); //Store these - cellDimX = cellDimX * 16; - cellDimY = cellDimY * 16; + cellDimX = cellDimX * CELLEDGESIZE; + cellDimY = cellDimY * CELLEDGESIZE; cellDimZ = cellDimZ; config.cellDimX = cellDimX; config.cellDimY = cellDimY; config.cellDimZ = cellDimZ; //bound view to world - if(x > cellDimX * CELLEDGESIZE -sizex/2) DisplayedSegmentX = x = cellDimX * CELLEDGESIZE -sizex/2; - if(y > cellDimY * CELLEDGESIZE -sizey/2) DisplayedSegmentY = y = cellDimY * CELLEDGESIZE -sizey/2; + if(x > cellDimX -sizex/2) DisplayedSegmentX = x = cellDimX -sizex/2; + if(y > cellDimY -sizey/2) DisplayedSegmentY = y = cellDimY -sizey/2; if(x < -sizex/2) DisplayedSegmentX = x = -sizex/2; if(y < -sizey/2) DisplayedSegmentY = y = -sizey/2; //setup new world segment WorldSegment* segment = new WorldSegment(x,y,z,sizex,sizey,sizez); - segment->regionSize.x = cellDimX * CELLEDGESIZE; - segment->regionSize.y = cellDimY * CELLEDGESIZE; + segment->regionSize.x = cellDimX; + segment->regionSize.y = cellDimY; segment->regionSize.z = cellDimZ; segment->rotation = DisplayedRotation; -- cgit v1.2.1