Type cast?
Hey guys. I have a problem with the following lines of code:
CA crashes when the function containing these lines runs and I'm strongly suspecting the problem is here. The temp and stat variables are of type float and as you can see, I am trying to make a calculation based on some coords I already got and the current coords of whatever player the pointer currently holds (pPlayer is initialized from getplayerbyindex). So what am I doing wrong here? origin is a D3DVector type but aren't that type made up of float as well, should I really need to typecast anything here? Would be great if someone could help out and also explain what I'm doing wrong so I know to next time.
tempx = statx - pPlayer->obj->origin.x;
tempy = staty - pPlayer->obj->origin.y;
tempz = statz - pPlayer->obj->origin.z;
tempy = staty - pPlayer->obj->origin.y;
tempz = statz - pPlayer->obj->origin.z;
