mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-09-01 04:01:56 +02:00
Prevent a potential division by zero.
This commit is contained in:
@@ -41,7 +41,7 @@ void AirVelocity::Draw()
|
||||
if (width*std::abs(dy) < height*std::abs(dx))
|
||||
diff = ((float)width)/((float)std::abs(dx));
|
||||
else
|
||||
diff = ((float)height)/((float)std::abs(dy));
|
||||
diff = (dy == 0) ? 0 : (((float)height)/((float)std::abs(dy)));
|
||||
|
||||
float circx = (diff/1.5f) * (endx - pos.X) + endx;
|
||||
float circy = (diff/1.5f) * (endy - pos.Y) + endy;
|
||||
|
Reference in New Issue
Block a user