that .5f should have been ouside the remainder_p

also fix random compile warning (error?)
This commit is contained in:
jacob1 2016-03-12 13:24:59 -05:00
parent d334209027
commit ccec5fbff4
2 changed files with 7 additions and 7 deletions

View File

@ -2406,9 +2406,9 @@ int Simulation::do_move(int i, int x, int y, float nxf, float nyf)
bool x_ok = (nx >= CELL && nx < XRES-CELL);
bool y_ok = (ny >= CELL && ny < YRES-CELL);
if (!x_ok)
nxf = remainder_p(nxf-CELL, XRES-CELL*2.5f)+CELL;
nxf = remainder_p(nxf-CELL, XRES-CELL*2.0f)+CELL-.5f;
if (!y_ok)
nyf = remainder_p(nyf-CELL, YRES-CELL*2.5f)+CELL;
nyf = remainder_p(nyf-CELL, YRES-CELL*2.0f)+CELL-.5f;
nx = (int)(nxf+0.5f);
ny = (int)(nyf+0.5f);
@ -4079,9 +4079,9 @@ killed:
bool x_ok = (fin_x >= CELL && fin_x < XRES-CELL);
bool y_ok = (fin_y >= CELL && fin_y < YRES-CELL);
if (!x_ok)
fin_xf = remainder_p(fin_xf-CELL, XRES-CELL*2.5f)+CELL;
fin_xf = remainder_p(fin_xf-CELL, XRES-CELL*2.0f)+CELL-.5f;
if (!y_ok)
fin_yf = remainder_p(fin_yf-CELL, YRES-CELL*2.5f)+CELL;
fin_yf = remainder_p(fin_yf-CELL, YRES-CELL*2.0f)+CELL-.5f;
fin_x = (int)(fin_xf+0.5f);
fin_y = (int)(fin_yf+0.5f);
}
@ -4132,12 +4132,12 @@ killed:
int oldnx = nx, oldny = ny;
if (!x_ok)
{
parts[i].x = remainder_p(parts[i].x-CELL, XRES-CELL*2.5f)+CELL;
parts[i].x = remainder_p(parts[i].x-CELL, XRES-CELL*2.0f)+CELL-.5f;
nx = (int)((float)parts[i].x+0.5f);
}
if (!y_ok)
{
parts[i].y = remainder_p(parts[i].y-CELL, YRES-CELL*2.5f)+CELL;
parts[i].y = remainder_p(parts[i].y-CELL, YRES-CELL*2.0f)+CELL-.5f;
ny = (int)((float)parts[i].y+0.5f);
}

View File

@ -2,7 +2,7 @@
#define TASK_H_
#include <string>
#include "common/tpt-thread.h"s
#include "common/tpt-thread.h"
#include "TaskListener.h"
#include "Config.h"