aboutsummaryrefslogtreecommitdiff
path: root/src/Person.cpp
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2021-12-09 23:07:32 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2021-12-09 23:37:37 +0700
commit48417e11854f832c40a42ec497cad3b275b57b2e (patch)
tree73162cd7294a49ba39f0f06afd16da74dee0f6da /src/Person.cpp
parente4888c19818ef61264ea4e1b0da9ebdc302f1483 (diff)
downloadblackshades-48417e11854f832c40a42ec497cad3b275b57b2e.tar.gz
Make XYZ C-compatible
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();