mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #3176
3176: Fix float loops r=def- a=Jupeyy Tested that one map from #bug channel Co-authored-by: Jupeyy <jupjopjap@gmail.com>
This commit is contained in:
commit
f74c3e5776
|
@ -1027,7 +1027,7 @@ int CCollision::GetIndex(vec2 PrevPos, vec2 Pos)
|
|||
int Nx = 0;
|
||||
int Ny = 0;
|
||||
|
||||
for(int i = 0, id = (int)Distance; i <= id; i++)
|
||||
for(int i = 0, id = (int)ceilf(Distance); i < id; i++)
|
||||
{
|
||||
a = (float)i / Distance;
|
||||
Tmp = mix(PrevPos, Pos, a);
|
||||
|
@ -1193,7 +1193,7 @@ int CCollision::IntersectNoLaser(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2
|
|||
float d = distance(Pos0, Pos1);
|
||||
vec2 Last = Pos0;
|
||||
|
||||
for(int i = 0, id = (int)d; i <= id; i++)
|
||||
for(int i = 0, id = (int)ceilf(d); i < id; i++)
|
||||
{
|
||||
float a = (int)i / d;
|
||||
vec2 Pos = mix(Pos0, Pos1, a);
|
||||
|
@ -1224,7 +1224,7 @@ int CCollision::IntersectNoLaserNW(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, ve
|
|||
float d = distance(Pos0, Pos1);
|
||||
vec2 Last = Pos0;
|
||||
|
||||
for(int i = 0, id = (int)d; i <= id; i++)
|
||||
for(int i = 0, id = (int)ceilf(d); i < id; i++)
|
||||
{
|
||||
float a = (float)i / d;
|
||||
vec2 Pos = mix(Pos0, Pos1, a);
|
||||
|
@ -1253,7 +1253,7 @@ int CCollision::IntersectAir(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pO
|
|||
float d = distance(Pos0, Pos1);
|
||||
vec2 Last = Pos0;
|
||||
|
||||
for(int i = 0, id = (int)d; i <= id; i++)
|
||||
for(int i = 0, id = (int)ceilf(d); i < id; i++)
|
||||
{
|
||||
float a = (float)i / d;
|
||||
vec2 Pos = mix(Pos0, Pos1, a);
|
||||
|
|
Loading…
Reference in a new issue