Wheeee!!!
Now that my function works with pointers instead of actual structures everything is ok.
void adddoll(RagDoll *doll)
{
float BodyLength=doll->BodyLength;
float BodyFat=doll->BodyFat;
float ThighLength=doll->ThighLength;
........................
head = cpBodyNew(0.2, cpMomentForCircle(0.2, 0, abs(SKX)*HeadSize, cpvzero));
head->p = cpv(initX+SKX*(HeadSize/5), initY+SKY*(BodyLength/2+HeadSize));
cpSpaceAddBody(space, head);
........................
doll->head=head;
}
After using that function to create an actual ragdoll
adddoll(player1);
I can adress player1's head (and other parts)
player1.head->t=20000;
or
player1ptr->head->t=20000;
Both ways work just fine.
No trouble with multiple ragdolls too.
I still don't understand why it didn't work without pointers. Pointers always confused me...
