hello, sometimes i have this error when i recreate the level.
the solution i found for this bug is to add this line :
before :
my solution is good ?
why this bug ?
maybe the use of int instead uint for initialize a array is not very smart
Quote:
RangeError: Error #1005: L'index du tableau n'est pas un entier positif (-1).
at Error$/throwError()
at Array()
at Box2D.Dynamics::b2Island()[C:\Program Files\_travail\xampp\htdocs\_progFlash\_flashdevelop\jeux1b\src\Box2D\Dynamics\b2Island.as:141]
at Error$/throwError()
at Array()
at Box2D.Dynamics::b2Island()[C:\Program Files\_travail\xampp\htdocs\_progFlash\_flashdevelop\jeux1b\src\Box2D\Dynamics\b2Island.as:141]
the solution i found for this bug is to add this line :
Code:
jointCapacity = jointCapacity < 0 ? 0 : jointCapacity;
before :
Code:
m_joints = new Array(jointCapacity);
for (i = 0; i < jointCapacity; i++)
m_joints[i] = null;
for (i = 0; i < jointCapacity; i++)
m_joints[i] = null;
my solution is good ?
why this bug ?
maybe the use of int instead uint for initialize a array is not very smart