Ranger should be the only one updating the ranger-specific shooting animation
This commit is contained in:
+13
-11
@@ -544,16 +544,18 @@ void Player::SetVelocity(vf2d vel){
|
||||
}
|
||||
|
||||
void Player::SetAnimationBasedOnTargetingDirection(float targetDirection){
|
||||
if(targetDirection<=PI/4&&targetDirection>-PI/4){
|
||||
UpdateAnimation(AnimationState::RANGER_SHOOT_E);
|
||||
} else
|
||||
if(targetDirection>=3*PI/4||targetDirection<-3*PI/4){
|
||||
UpdateAnimation(AnimationState::RANGER_SHOOT_W);
|
||||
} else
|
||||
if(targetDirection<=3*PI/4&&targetDirection>PI/4){
|
||||
UpdateAnimation(AnimationState::RANGER_SHOOT_S);
|
||||
} else
|
||||
if(targetDirection>=-3*PI/4&&targetDirection<-PI/4){
|
||||
UpdateAnimation(AnimationState::RANGER_SHOOT_N);
|
||||
if(GetClass()==Class::RANGER){
|
||||
if(targetDirection<=PI/4&&targetDirection>-PI/4){
|
||||
UpdateAnimation(AnimationState::RANGER_SHOOT_E);
|
||||
} else
|
||||
if(targetDirection>=3*PI/4||targetDirection<-3*PI/4){
|
||||
UpdateAnimation(AnimationState::RANGER_SHOOT_W);
|
||||
} else
|
||||
if(targetDirection<=3*PI/4&&targetDirection>PI/4){
|
||||
UpdateAnimation(AnimationState::RANGER_SHOOT_S);
|
||||
} else
|
||||
if(targetDirection>=-3*PI/4&&targetDirection<-PI/4){
|
||||
UpdateAnimation(AnimationState::RANGER_SHOOT_N);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user