summary refs log tree commit diff
path: root/src/Person.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Person.cpp')
-rw-r--r--src/Person.cpp42
1 files changed, 11 insertions, 31 deletions
diff --git a/src/Person.cpp b/src/Person.cpp
index dca3bbb..4097aa5 100644
--- a/src/Person.cpp
+++ b/src/Person.cpp
@@ -313,33 +313,14 @@ void Person::DoAnimations(int who)
 
 	//Look up+down
 	if(!skeleton.free&&(whichgun!=nogun||who==0)&&health==100&&currentanimation!=lyinganim&&currentanimation!=getupfrontanim&&currentanimation!=getupbackanim&&currentanimation!=diveanim&&targetanimation!=diveanim&&targetanimation!=throwanim&&targetanimation!=thrownanim){
-		XYZ facing;
-		XYZ facingdown;
-		XYZ facinghalf;
-		XYZ facingright;
-		if(who==0){
-			playerrotation2=camera.rotation2;
-			//Facing
-			facing=0;
-			facing.z=1;
-
-			facinghalf=DoRotation(facing,playerrotation2/2,0,0);
-			facinghalf=DoRotation(facinghalf,0,-7,0);
-			facing=DoRotation(facing,playerrotation2,0,0);
-			facingright=DoRotation(facing,0,-90,0);
-			facingdown=DoRotation(facing,90,0,0);
-		}
-		if(who!=0){
-			//Facing
-			facing=0;
-			facing.z=1;
-
-			facinghalf=DoRotation(facing,playerrotation2/2,0,0);
-			facinghalf=DoRotation(facinghalf,0,-7,0);
-			facing=DoRotation(facing,playerrotation2,0,0);
-			facingright=DoRotation(facing,0,-90,0);
-			facingdown=DoRotation(facing,90,0,0);
-		}
+		if (who == 0)
+			playerrotation2 = camera.rotation2;
+		XYZ facing {0.0f, 0.0f, 1.0f};
+		XYZ facinghalf = DoRotation(DoRotation(facing,
+			playerrotation2 / 2, 0, 0), 0, -7, 0);
+		facing = DoRotation(facing, playerrotation2, 0, 0);
+		XYZ facingright = DoRotation(facing, 0, -90, 0);
+		XYZ facingdown = DoRotation(facing, 90, 0, 0);
 		XYZ rotatearound;
 		XYZ oldpos;
 		switch (whichgun) {
@@ -714,9 +695,8 @@ void Person::DoStuff(int who)
 	if (backwardsanim)
 		facing *= -1;
 
-	if(onground){
-		velocity=0;
-	}
+	if(onground)
+		velocity = {};
 	if(((currentanimation==joganim||currentanimation==zombiejoganim||currentanimation==diveanim)&&onground)||(who==0&&visions==1&&((currentanimation==joganim||currentanimation==walkanim||currentanimation==diveanim)||(currentanimation==zombiejoganim||currentanimation==zombiewalkanim)))){
 		playercoords+=facing*multiplier*15*speed;
 		velocity.x=facing.x*15*speed;
@@ -961,7 +941,7 @@ int Person::DrawSkeleton(int who)
 						skeleton.offset = 1;
 						joint.offset -= normal * multiplier * 5;
 					} else {
-						joint.offset=0;
+						joint.offset = {};
 					}
 				}
 				skeleton.DoConstraints();