vector iterators incompatible
Aug 10, 2012 at 11:13am UTC
Hi, I have problem compiling this code in debug mode code works fine in release mode but I need debug mode and it crash at this->nodes.push_back
and debugger say: debug assertion failed! include\vector Line: 238 expression: vector iterators incompatible,
it's strange cause I do same thing with other vectors earlier without any problem.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
Class Scene
{
...
std::vector <Node> nodes;
...
};
case 8:
{
node+=2;
numLinks = ((WORD*)node)[0];
node+=2;
sprintf(chc,"RestartNode%d" ,restartIndex);
name = Checksum(chc);
links = (WORD*)node;
for (DWORD j=0; j<numLinks; j++)
node+=2;
if (links[numLinks]==0)
node+=2;
vert = (Th2FixedVert*)node;
node+=12;
position.x = -(float )vert->x/2.833f;
position.y = -(float )vert->y/2.833f;
position.z = -(float )vert->z/2.833f;
//0.003069460
//0.0030679615
//0.0015339807
//full circle is 4096(divider for Th2FixedVert) since level is flipped need - on all axes but y needs to be rotated 180 degree after.
angle.x = -((D3DX_PI/2048.0f) * ((float )(int )((short *)node)[0]-2048.0f));
angle.y = -((D3DX_PI/2048.0f) * ((float )(int )((short *)node)[1]-2048.0f))+D3DX_PI;
angle.z = -((D3DX_PI/2048.0f) * ((float )(int )((short *)node)[2]-2048.0f));
node+=6;
this ->nodes.push_back(Restart(position,angle,name,(char *)node,numLinks,links));
restartIndex++;
break ;
}
Any ideas?
Last edited on Aug 10, 2012 at 11:39am UTC
Topic archived. No new replies allowed.