Okay,
i created this function(hi otter^^):
function TrackHead(ENTITY* AEnt, VECTOR* APos)
{
VECTOR LTemp;
VECTOR LHeadPos;
ANGLE LBoneRot;
ANGLE LTotalRot;
ANGLE LDiffRot;
ANGLE LEntDiff;
vec_for_bone(LHeadPos, AEnt, "Bone8");
vec_set(LTemp,APos);
vec_sub(LTemp, AEnt.x);
vec_to_angle(LTotalRot, LTemp);
ang_for_bone(LBoneRot, AEnt, "Bone8");
ang_diff(LDiffRot, LTotalRot, LBoneRot);
//ang_diff(LEntDiff, AEnt.pan, LBoneRot);//Nasty line
ent_bonerotate(AEnt, "Bone8", LBoneRot);
ent_bonerotate(AEnt, "Bone8", LDiffRot);
}
The problem is, commenting out/uncommenting the "nasty" line, changes the output result(final head rotation), while LEntDiff is never used.
Somehow it seems to manipulate LBoneRot o.O
EDIT: wtf noticed when doing
vec_set(GRot2, LBoneRot);//GRot2 is global
it changes LBoneRot too o.o.
Something absolutely strange is happening >.<.
Missuse of Vars..? I have no idea since i cant explain the behaviour.
Greetings
Rackscha