aboutsummaryrefslogtreecommitdiff
path: root/src/GameTick.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/GameTick.cpp')
-rw-r--r--src/GameTick.cpp123
1 files changed, 60 insertions, 63 deletions
diff --git a/src/GameTick.cpp b/src/GameTick.cpp
index f3ce015..4182c71 100644
--- a/src/GameTick.cpp
+++ b/src/GameTick.cpp
@@ -60,9 +60,9 @@ void Game::Splat(int k)
person[k].DoAnimations(k);
auto& joints = skeleton.joints;
- auto& head_joint = joints[skeleton.jointlabels[head]];
+ auto& head_joint = joints[head];
person[k].bjoint1 = &head_joint;
- person[k].bjoint2 = joints + skeleton.jointlabels[neck];
+ person[k].bjoint2 = joints + neck;
for (auto& joint : joints) {
joint.position = DoRotation(joint.position + joint.offset, 0,
@@ -269,7 +269,7 @@ void click(Game* game, int button, int action, int mods)
if (weapon == grenade && player.ammo > 0
&& player.reloading <= 0 && player.attackframe < 0) {
auto& skeleton = player.skeleton;
- auto& hand = skeleton.joints[skeleton.jointlabels[righthand]];
+ auto& hand = skeleton.joints[righthand];
auto soundsrc = DoRotation(hand.position, 0, player.playerrotation, 0)
+ player.playercoords - camera.position;
if (player.grenphase) {
@@ -356,9 +356,7 @@ void Game::setListener(XYZ& facing)
XYZ Game::aimPlayer()
{
auto& joints = person[0].skeleton.joints;
- auto& jointlabels = person[0].skeleton.jointlabels;
- auto point = joints[jointlabels[lefthand]].position
- - joints[jointlabels[righthand]].position;
+ auto point = joints[lefthand].position - joints[righthand].position;
float aimrot = 0.0f, aimrot2 = 0.0f;
switch (person[0].whichgun) {
@@ -376,9 +374,9 @@ XYZ Game::aimPlayer()
case handgun2:
aimrot = -0.9f;
auto k = thirdperson ? 0.35 : 0.65;
- point = joints[jointlabels[righthand]].position
- - joints[jointlabels[head]].position * k
- - joints[jointlabels[neck]].position * (1 - k);
+ point = joints[righthand].position
+ - joints[head].position * k
+ - joints[neck].position * (1 - k);
break;
}
@@ -407,15 +405,14 @@ XYZ Game::aimBot(int j)
auto& target = person[person[j].killtarget];
auto& joints = target.skeleton.joints;
- auto& jointlabels = target.skeleton.jointlabels;
- XYZ aim = joints[jointlabels[abdomen]].position;
+ XYZ aim = joints[abdomen].position;
if (target.skeleton.free)
inaccuracy *= 3;
else
aim = DoRotation(aim, 0, target.playerrotation, 0)
+ target.playercoords;
- auto& lefthandpos = joints[jointlabels[lefthand]].position;
+ auto& lefthandpos = joints[lefthand].position;
aim -= person[j].playercoords
+ DoRotation(lefthandpos, 0, person[j].playerrotation, 0);
return DoRotation(
@@ -974,9 +971,9 @@ void Game::Tick()
for(int i=0;i<numpeople;i++){
if(person[i].health<0&&person[i].longdead<0&&person[i].firstlongdead==0){
if(person[i].type!=zombietype){
- overpoint=person[i].skeleton.joints[person[i].skeleton.jointlabels[abdomen]].position;
+ overpoint=person[i].skeleton.joints[abdomen].position;
overpoint.y+=3000;
- underpoint=person[i].skeleton.joints[person[i].skeleton.jointlabels[abdomen]].position;
+ underpoint=person[i].skeleton.joints[abdomen].position;
underpoint.y-=3000;
move=0;
@@ -994,7 +991,7 @@ void Game::Tick()
decals.MakeDecal(bloodpool,temp,12,normish, whichtri, &sidewalkcollide, move, cityrotation[person[i].whichblockx][person[i].whichblocky]*90);
}
if(whichtri==-1){
- temp=person[i].skeleton.joints[person[i].skeleton.jointlabels[abdomen]].position;
+ temp=person[i].skeleton.joints[abdomen].position;
temp.y=-.5;
move=0;
decals.MakeDecal(bloodpool,temp,12,normish, 0, &sidewalkcollide, move, 0);
@@ -1103,20 +1100,20 @@ void Game::Tick()
if(i > 0
&& person[i].targetanimation == zombieeatanim
&& person[person[i].killtarget].eaten == i) {
- person[person[i].killtarget].skeleton.joints[person[person[i].killtarget].skeleton.jointlabels[head]].locked=1;
- person[person[i].killtarget].skeleton.joints[person[person[i].killtarget].skeleton.jointlabels[rightshoulder]].locked=1;
+ person[person[i].killtarget].skeleton.joints[head].locked=1;
+ person[person[i].killtarget].skeleton.joints[rightshoulder].locked=1;
for(int k=0;k<2;k++){
- person[person[i].killtarget].skeleton.joints[person[person[i].killtarget].skeleton.jointlabels[head]].position=DoRotation(person[i].skeleton.joints[person[i].skeleton.jointlabels[righthand]].position,0,person[i].playerrotation,0)+person[i].playercoords;
- person[person[i].killtarget].skeleton.joints[person[person[i].killtarget].skeleton.jointlabels[head]].velocity=0;
- person[person[i].killtarget].skeleton.joints[person[person[i].killtarget].skeleton.jointlabels[rightshoulder]].position=DoRotation(person[i].skeleton.joints[person[i].skeleton.jointlabels[lefthand]].position,0,person[i].playerrotation,0)+person[i].playercoords;
- person[person[i].killtarget].skeleton.joints[person[person[i].killtarget].skeleton.jointlabels[rightshoulder]].velocity=0;
+ person[person[i].killtarget].skeleton.joints[head].position=DoRotation(person[i].skeleton.joints[righthand].position,0,person[i].playerrotation,0)+person[i].playercoords;
+ person[person[i].killtarget].skeleton.joints[head].velocity=0;
+ person[person[i].killtarget].skeleton.joints[rightshoulder].position=DoRotation(person[i].skeleton.joints[lefthand].position,0,person[i].playerrotation,0)+person[i].playercoords;
+ person[person[i].killtarget].skeleton.joints[rightshoulder].velocity=0;
person[person[i].killtarget].skeleton.DoConstraints();
person[person[i].killtarget].skeleton.DoConstraints(&blocksimplecollide[citytype[person[i].whichblockx][person[i].whichblocky]],&move,cityrotation[person[i].whichblockx][person[i].whichblocky]*90);
}
- person[person[i].killtarget].skeleton.joints[person[person[i].killtarget].skeleton.jointlabels[head]].locked=0;
- person[person[i].killtarget].skeleton.joints[person[person[i].killtarget].skeleton.jointlabels[rightshoulder]].locked=0;
+ person[person[i].killtarget].skeleton.joints[head].locked=0;
+ person[person[i].killtarget].skeleton.joints[rightshoulder].locked=0;
person[person[i].killtarget].longdead=1;
}
@@ -1482,8 +1479,8 @@ void Game::Tick()
auto stabpos = person[i].playercoords + flatfacing - camera.position;
playSound(gSourceID[knifeslashsound],
stabpos.x, stabpos.y, stabpos.z);
- person[person[i].killtarget].bjoint1=&person[person[i].killtarget].skeleton.joints[person[person[i].killtarget].skeleton.jointlabels[neck]];
- person[person[i].killtarget].bjoint2=&person[person[i].killtarget].skeleton.joints[person[person[i].killtarget].skeleton.jointlabels[neck]];
+ person[person[i].killtarget].bjoint1=&person[person[i].killtarget].skeleton.joints[neck];
+ person[person[i].killtarget].bjoint2=&person[person[i].killtarget].skeleton.joints[neck];
person[person[i].killtarget].bleeding=1;
person[person[i].killtarget].bleeddelay=1;
person[person[i].killtarget].health-=20;
@@ -1608,7 +1605,7 @@ void Game::Tick()
person[i].playercoords.y = joint.position.y;
//Find orientation
- XYZ firsttop=person[i].skeleton.joints[person[i].skeleton.jointlabels[neck]].position-person[i].skeleton.joints[person[i].skeleton.jointlabels[groin]].position;
+ XYZ firsttop=person[i].skeleton.joints[neck].position-person[i].skeleton.joints[groin].position;
Normalise(&firsttop);
person[i].playerrotation=acos(0-firsttop.z);
person[i].playerrotation*=360/6.28;
@@ -1639,21 +1636,21 @@ void Game::Tick()
playSound(gSourceID[knifeslashsound],
soundpos.x, soundpos.y, soundpos.z);
- person[person[0].killtarget].bjoint1=&person[person[0].killtarget].skeleton.joints[person[person[0].killtarget].skeleton.jointlabels[neck]];
- person[person[0].killtarget].bjoint2=&person[person[0].killtarget].skeleton.joints[person[person[0].killtarget].skeleton.jointlabels[neck]];
+ person[person[0].killtarget].bjoint1=&person[person[0].killtarget].skeleton.joints[neck];
+ person[person[0].killtarget].bjoint2=&person[person[0].killtarget].skeleton.joints[neck];
person[person[0].killtarget].bleeding=1;
person[person[0].killtarget].bleeddelay=1;
- person[0].bjoint1=&person[0].skeleton.joints[person[0].skeleton.jointlabels[righthand]];
- person[0].bjoint2=&person[0].skeleton.joints[person[0].skeleton.jointlabels[righthand]];
+ person[0].bjoint1=&person[0].skeleton.joints[righthand];
+ person[0].bjoint2=&person[0].skeleton.joints[righthand];
person[0].bleeding=1;
person[0].bleeddelay=1;
velocity=DoRotation(flatfacing,0,70,0)*50+person[0].velocity*2;
velocity.y+=30;
- sprites.MakeSprite(bloodspritedown, .8, 1, .2, .2,DoRotation(person[person[0].killtarget].skeleton.joints[person[person[0].killtarget].skeleton.jointlabels[neck]].position,0,person[person[0].killtarget].playerrotation,0)+person[person[0].killtarget].playercoords, velocity*.3, 2);
- sprites.MakeSprite(bloodspritedown, .8, 1, .2, .2,DoRotation(person[person[0].killtarget].skeleton.joints[person[person[0].killtarget].skeleton.jointlabels[neck]].position,0,person[person[0].killtarget].playerrotation,0)+person[person[0].killtarget].playercoords, velocity*.2, 3);
- sprites.MakeSprite(bloodspritedown, .8, 1, .2, .2,DoRotation(person[person[0].killtarget].skeleton.joints[person[person[0].killtarget].skeleton.jointlabels[neck]].position,0,person[person[0].killtarget].playerrotation,0)+person[person[0].killtarget].playercoords, velocity*.1, 4);
+ sprites.MakeSprite(bloodspritedown, .8, 1, .2, .2,DoRotation(person[person[0].killtarget].skeleton.joints[neck].position,0,person[person[0].killtarget].playerrotation,0)+person[person[0].killtarget].playercoords, velocity*.3, 2);
+ sprites.MakeSprite(bloodspritedown, .8, 1, .2, .2,DoRotation(person[person[0].killtarget].skeleton.joints[neck].position,0,person[person[0].killtarget].playerrotation,0)+person[person[0].killtarget].playercoords, velocity*.2, 3);
+ sprites.MakeSprite(bloodspritedown, .8, 1, .2, .2,DoRotation(person[person[0].killtarget].skeleton.joints[neck].position,0,person[person[0].killtarget].playerrotation,0)+person[person[0].killtarget].playercoords, velocity*.1, 4);
}
person[person[0].killtarget].health-=100;
@@ -1672,8 +1669,8 @@ void Game::Tick()
}
if(person[0].whichgun!=knife){
- person[person[0].killtarget].skeleton.joints[person[person[0].killtarget].skeleton.jointlabels[head]].velocity+=DoRotation(flatfacing,0,40,0)*50;
- person[person[0].killtarget].skeleton.joints[person[person[0].killtarget].skeleton.jointlabels[head]].velocity+=person[0].velocity*2;
+ person[person[0].killtarget].skeleton.joints[head].velocity+=DoRotation(flatfacing,0,40,0)*50;
+ person[person[0].killtarget].skeleton.joints[head].velocity+=person[0].velocity*2;
}
} else if (!whacked) {
whacked = true;
@@ -1684,13 +1681,13 @@ void Game::Tick()
playSound(gSourceID[knifeslashsound],
soundpos.x, soundpos.y, soundpos.z);
- person[person[0].killtarget].bjoint1=&person[person[0].killtarget].skeleton.joints[person[person[0].killtarget].skeleton.jointlabels[neck]];
- person[person[0].killtarget].bjoint2=&person[person[0].killtarget].skeleton.joints[person[person[0].killtarget].skeleton.jointlabels[neck]];
+ person[person[0].killtarget].bjoint1=&person[person[0].killtarget].skeleton.joints[neck];
+ person[person[0].killtarget].bjoint2=&person[person[0].killtarget].skeleton.joints[neck];
person[person[0].killtarget].bleeddelay=1;
- person[0].bjoint1=&person[0].skeleton.joints[person[0].skeleton.jointlabels[righthand]];
- person[0].bjoint2=&person[0].skeleton.joints[person[0].skeleton.jointlabels[righthand]];
+ person[0].bjoint1=&person[0].skeleton.joints[righthand];
+ person[0].bjoint2=&person[0].skeleton.joints[righthand];
person[0].bleeding=1;
person[0].bleeddelay=1;
@@ -1698,9 +1695,9 @@ void Game::Tick()
velocity=DoRotation(flatfacing,0,70,0)*50+person[0].velocity*2;
velocity.y+=30;
- sprites.MakeSprite(bloodspritedown, .8, 1, .2, .2,DoRotation(person[person[0].killtarget].skeleton.joints[person[person[0].killtarget].skeleton.jointlabels[neck]].position,0,person[person[0].killtarget].playerrotation,0)+person[person[0].killtarget].playercoords, velocity*.3, 2);
- sprites.MakeSprite(bloodspritedown, .8, 1, .2, .2,DoRotation(person[person[0].killtarget].skeleton.joints[person[person[0].killtarget].skeleton.jointlabels[neck]].position,0,person[person[0].killtarget].playerrotation,0)+person[person[0].killtarget].playercoords, velocity*.2, 3);
- sprites.MakeSprite(bloodspritedown, .8, 1, .2, .2,DoRotation(person[person[0].killtarget].skeleton.joints[person[person[0].killtarget].skeleton.jointlabels[neck]].position,0,person[person[0].killtarget].playerrotation,0)+person[person[0].killtarget].playercoords, velocity*.1, 4);
+ sprites.MakeSprite(bloodspritedown, .8, 1, .2, .2,DoRotation(person[person[0].killtarget].skeleton.joints[neck].position,0,person[person[0].killtarget].playerrotation,0)+person[person[0].killtarget].playercoords, velocity*.3, 2);
+ sprites.MakeSprite(bloodspritedown, .8, 1, .2, .2,DoRotation(person[person[0].killtarget].skeleton.joints[neck].position,0,person[person[0].killtarget].playerrotation,0)+person[person[0].killtarget].playercoords, velocity*.2, 3);
+ sprites.MakeSprite(bloodspritedown, .8, 1, .2, .2,DoRotation(person[person[0].killtarget].skeleton.joints[neck].position,0,person[person[0].killtarget].playerrotation,0)+person[person[0].killtarget].playercoords, velocity*.1, 4);
}
person[person[0].killtarget].health-=200;
@@ -1720,8 +1717,8 @@ void Game::Tick()
}
if(person[0].whichgun!=knife){
- person[person[0].killtarget].skeleton.joints[person[person[0].killtarget].skeleton.jointlabels[head]].velocity+=DoRotation(flatfacing,0,40,0)*50;
- person[person[0].killtarget].skeleton.joints[person[person[0].killtarget].skeleton.jointlabels[head]].velocity+=person[0].velocity*2;
+ person[person[0].killtarget].skeleton.joints[head].velocity+=DoRotation(flatfacing,0,40,0)*50;
+ person[person[0].killtarget].skeleton.joints[head].velocity+=person[0].velocity*2;
}
}
}
@@ -1846,10 +1843,10 @@ void Game::Tick()
switch (person[j].whichgun) {
case handgun1:
case handgun2:
- aimjoint = person[j].skeleton.jointlabels[rightwrist];
+ aimjoint = rightwrist;
break;
default:
- aimjoint = person[j].skeleton.jointlabels[lefthand];
+ aimjoint = lefthand;
}
start = person[j].playercoords
+ DoRotation(person[j].skeleton.joints[aimjoint].position,
@@ -2260,7 +2257,7 @@ void Game::Tick()
if(&person[whichhit].skeleton.joints[j]==hitstruct.joint1||&person[whichhit].skeleton.joints[j]==hitstruct.joint2){
- if(j!=person[whichhit].skeleton.jointlabels[abdomen]&&j!=person[whichhit].skeleton.jointlabels[groin]&&j!=person[whichhit].skeleton.jointlabels[neck]){
+ if (j != abdomen && j != groin && j != neck) {
sprites.MakeSprite(bloodspritedown, .8, 1, .2, .2,person[whichhit].skeleton.joints[j].position, person[whichhit].skeleton.joints[j].velocity/3, 9);
@@ -2469,19 +2466,19 @@ void Game::Tick()
if(!zoom||j!=0){
- if(person[j].whichgun==assaultrifle)aim=DoRotation(person[j].skeleton.joints[(person[j].skeleton.jointlabels[lefthand])].position-person[j].skeleton.joints[(person[j].skeleton.jointlabels[righthand])].position,0,person[j].playerrotation-2.5,0);
+ if(person[j].whichgun==assaultrifle)aim=DoRotation(person[j].skeleton.joints[lefthand].position-person[j].skeleton.joints[righthand].position,0,person[j].playerrotation-2.5,0);
- if(person[j].whichgun==sniperrifle)aim=DoRotation(person[j].skeleton.joints[(person[j].skeleton.jointlabels[lefthand])].position-person[j].skeleton.joints[(person[j].skeleton.jointlabels[righthand])].position,0,person[j].playerrotation+4,0);
+ if(person[j].whichgun==sniperrifle)aim=DoRotation(person[j].skeleton.joints[lefthand].position-person[j].skeleton.joints[righthand].position,0,person[j].playerrotation+4,0);
- if(person[j].whichgun==shotgun)aim=DoRotation(person[j].skeleton.joints[(person[j].skeleton.jointlabels[lefthand])].position-person[j].skeleton.joints[(person[j].skeleton.jointlabels[righthand])].position,0,person[j].playerrotation+4,0);
+ if(person[j].whichgun==shotgun)aim=DoRotation(person[j].skeleton.joints[lefthand].position-person[j].skeleton.joints[righthand].position,0,person[j].playerrotation+4,0);
- if(person[j].whichgun==handgun1&&!thirdperson&&j==0)aim=DoRotation(person[j].skeleton.joints[(person[j].skeleton.jointlabels[righthand])].position-(person[j].skeleton.joints[person[j].skeleton.jointlabels[head]].position*.65+person[j].skeleton.joints[person[j].skeleton.jointlabels[neck]].position*.35),0,person[j].playerrotation-.9,0);
+ if(person[j].whichgun==handgun1&&!thirdperson&&j==0)aim=DoRotation(person[j].skeleton.joints[righthand].position-(person[j].skeleton.joints[head].position*.65+person[j].skeleton.joints[neck].position*.35),0,person[j].playerrotation-.9,0);
- if(person[j].whichgun==handgun1&&(thirdperson||j!=0))aim=DoRotation(person[j].skeleton.joints[(person[j].skeleton.jointlabels[righthand])].position-(person[j].skeleton.joints[person[j].skeleton.jointlabels[head]].position*.35+person[j].skeleton.joints[person[j].skeleton.jointlabels[neck]].position*.65),0,person[j].playerrotation-.9,0);
+ if(person[j].whichgun==handgun1&&(thirdperson||j!=0))aim=DoRotation(person[j].skeleton.joints[righthand].position-(person[j].skeleton.joints[head].position*.35+person[j].skeleton.joints[neck].position*.65),0,person[j].playerrotation-.9,0);
- if(person[j].whichgun==handgun2&&!thirdperson&&j==0)aim=DoRotation(person[j].skeleton.joints[(person[j].skeleton.jointlabels[righthand])].position-(person[j].skeleton.joints[person[j].skeleton.jointlabels[head]].position*.65+person[j].skeleton.joints[person[j].skeleton.jointlabels[neck]].position*.35),0,person[j].playerrotation-.9,0);
+ if(person[j].whichgun==handgun2&&!thirdperson&&j==0)aim=DoRotation(person[j].skeleton.joints[righthand].position-(person[j].skeleton.joints[head].position*.65+person[j].skeleton.joints[neck].position*.35),0,person[j].playerrotation-.9,0);
- if(person[j].whichgun==handgun2&&(thirdperson||j!=0))aim=DoRotation(person[j].skeleton.joints[(person[j].skeleton.jointlabels[righthand])].position-(person[j].skeleton.joints[person[j].skeleton.jointlabels[head]].position*.35+person[j].skeleton.joints[person[j].skeleton.jointlabels[neck]].position*.65),0,person[j].playerrotation-.9,0);
+ if(person[j].whichgun==handgun2&&(thirdperson||j!=0))aim=DoRotation(person[j].skeleton.joints[righthand].position-(person[j].skeleton.joints[head].position*.35+person[j].skeleton.joints[neck].position*.65),0,person[j].playerrotation-.9,0);
}
@@ -2497,7 +2494,7 @@ void Game::Tick()
if(person[j].whichgun==sniperrifle){
- start=person[j].playercoords+DoRotation(person[j].skeleton.joints[(person[j].skeleton.jointlabels[lefthand])].position,0,person[j].playerrotation,0);
+ start=person[j].playercoords+DoRotation(person[j].skeleton.joints[lefthand].position,0,person[j].playerrotation,0);
start-=DoRotation(DoRotation(DoRotation(aim,0,-person[j].playerrotation,0),90,0,0),0,person[j].playerrotation,0)*(0-.4);
@@ -2505,7 +2502,7 @@ void Game::Tick()
if(person[j].whichgun==shotgun){
- start=person[j].playercoords+DoRotation(person[j].skeleton.joints[(person[j].skeleton.jointlabels[lefthand])].position,0,person[j].playerrotation,0);
+ start=person[j].playercoords+DoRotation(person[j].skeleton.joints[lefthand].position,0,person[j].playerrotation,0);
start-=DoRotation(DoRotation(DoRotation(aim,0,-person[j].playerrotation,0),90,0,0),0,person[j].playerrotation,0)*(0-.4);
@@ -2513,7 +2510,7 @@ void Game::Tick()
if(person[j].whichgun==handgun1){
- start=person[j].playercoords+DoRotation(person[j].skeleton.joints[(person[j].skeleton.jointlabels[rightwrist])].position,0,person[j].playerrotation,0);
+ start=person[j].playercoords+DoRotation(person[j].skeleton.joints[rightwrist].position,0,person[j].playerrotation,0);
start-=DoRotation(DoRotation(DoRotation(aim,0,-person[j].playerrotation,0),90,0,0),0,person[j].playerrotation,0)*(.55-.4);
@@ -2521,7 +2518,7 @@ void Game::Tick()
if(person[j].whichgun==handgun2){
- start=person[j].playercoords+DoRotation(person[j].skeleton.joints[(person[j].skeleton.jointlabels[rightwrist])].position,0,person[j].playerrotation,0);
+ start=person[j].playercoords+DoRotation(person[j].skeleton.joints[rightwrist].position,0,person[j].playerrotation,0);
start-=DoRotation(DoRotation(DoRotation(aim,0,-person[j].playerrotation,0),90,0,0),0,person[j].playerrotation,0)*(.55-.4);
@@ -2529,7 +2526,7 @@ void Game::Tick()
if(person[j].whichgun==assaultrifle){
- start=person[j].playercoords+DoRotation(person[j].skeleton.joints[(person[j].skeleton.jointlabels[lefthand])].position,0,person[j].playerrotation,0);
+ start=person[j].playercoords+DoRotation(person[j].skeleton.joints[lefthand].position,0,person[j].playerrotation,0);
start-=DoRotation(DoRotation(DoRotation(aim,0,-person[j].playerrotation,0),90,0,0),0,person[j].playerrotation,0)*(.25-.4);
@@ -2985,8 +2982,8 @@ void Game::Tick()
person[k].longdead = 1;
person[k].bleeddelay = 1;
- person[k].bjoint1 = &person[k].skeleton.joints[person[k].skeleton.jointlabels[head]];
- person[k].bjoint2 = &person[k].skeleton.joints[person[k].skeleton.jointlabels[neck]];
+ person[k].bjoint1 = &person[k].skeleton.joints[head];
+ person[k].bjoint2 = &person[k].skeleton.joints[neck];
for (auto& joint : person[k].skeleton.joints) {
joint.position = DoRotation(joint.position, 0, person[k].playerrotation, 0);
@@ -3035,9 +3032,9 @@ void Game::Tick()
//camera position
XYZ average;
- if(!zoom)average=person[0].skeleton.joints[(person[0].skeleton.jointlabels[head])].position*(person[0].aimamount/2+.5)+person[0].skeleton.joints[(person[0].skeleton.jointlabels[neck])].position*((1-person[0].aimamount)/2);
+ if(!zoom)average=person[0].skeleton.joints[head].position*(person[0].aimamount/2+.5)+person[0].skeleton.joints[neck].position*((1-person[0].aimamount)/2);
- if(zoom)average=person[0].skeleton.joints[(person[0].skeleton.jointlabels[righthand])].position;
+ if(zoom)average=person[0].skeleton.joints[righthand].position;
if(person[0].skeleton.free==0&&thirdperson!=2)camera.position=person[0].playercoords+DoRotation(average,0,person[0].playerrotation,0);