Fix some pasted particles not getting cut off at the edges of the simulation
The problem is that .x and .y may get rounded toward 0 when being converted to an int, the fix is to floor first.
This commit is contained in:
parent
b4d7d276a2
commit
c6c4b1de76
@ -42,8 +42,8 @@ void Simulation::Load(const GameSave *save, bool includePressure, Vec2<int> bloc
|
||||
|
||||
tempPart.x += (float)partP.X;
|
||||
tempPart.y += (float)partP.Y;
|
||||
int x = int(tempPart.x + 0.5f);
|
||||
int y = int(tempPart.y + 0.5f);
|
||||
int x = int(std::floor(tempPart.x + 0.5f));
|
||||
int y = int(std::floor(tempPart.y + 0.5f));
|
||||
|
||||
// Check various scenarios where we are unable to spawn the element, and set type to 0 to block spawning later
|
||||
if (!InBounds(x, y))
|
||||
|
Loading…
Reference in New Issue
Block a user