Pass object_base &to ai_turn_randomly
This commit is contained in:
parent
c5f933b462
commit
bce267f82f
|
@ -586,7 +586,7 @@ void ai_turn_towards_vector(const vms_vector &goal_vector, object_base &objp, fi
|
|||
}
|
||||
|
||||
#if defined(DXX_BUILD_DESCENT_I)
|
||||
static void ai_turn_randomly(const vms_vector &vec_to_player, const vobjptr_t obj, fix rate, int previous_visibility)
|
||||
static void ai_turn_randomly(const vms_vector &vec_to_player, object_base &obj, fix rate, int previous_visibility)
|
||||
{
|
||||
vms_vector curvec;
|
||||
|
||||
|
@ -599,7 +599,7 @@ static void ai_turn_randomly(const vms_vector &vec_to_player, const vobjptr_t ob
|
|||
//--debug-- if (d_rand() > 0x6000)
|
||||
//--debug-- Prevented_turns++;
|
||||
|
||||
curvec = obj->mtype.phys_info.rotvel;
|
||||
curvec = obj.mtype.phys_info.rotvel;
|
||||
|
||||
curvec.y += F1_0/64;
|
||||
|
||||
|
@ -611,7 +611,7 @@ static void ai_turn_randomly(const vms_vector &vec_to_player, const vobjptr_t ob
|
|||
if (abs(curvec.y) > F1_0/8) curvec.y /= 4;
|
||||
if (abs(curvec.z) > F1_0/8) curvec.z /= 4;
|
||||
|
||||
obj->mtype.phys_info.rotvel = curvec;
|
||||
obj.mtype.phys_info.rotvel = curvec;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1294,6 +1294,7 @@ void ai_path_set_orient_and_vel(const vobjptr_t objp, const vms_vector &goal_poi
|
|||
vm_vec_scale(norm_cur_vel, speed_scale);
|
||||
objp->mtype.phys_info.velocity = norm_cur_vel;
|
||||
|
||||
fix rate;
|
||||
if (ailp->mode == ai_mode::AIM_RUN_FROM_OBJECT
|
||||
#if defined(DXX_BUILD_DESCENT_II)
|
||||
|| robot_is_companion(robptr) == 1 || objp->ctype.ai_info.behavior == ai_behavior::AIB_SNIPE
|
||||
|
@ -1307,10 +1308,10 @@ void ai_path_set_orient_and_vel(const vobjptr_t objp, const vms_vector &goal_poi
|
|||
vm_vec_negate(norm_vec_to_goal);
|
||||
}
|
||||
#endif
|
||||
ai_turn_towards_vector(norm_vec_to_goal, objp, robptr->turn_time[NDL-1]/2);
|
||||
rate = robptr->turn_time[NDL - 1] / 2;
|
||||
} else
|
||||
ai_turn_towards_vector(norm_vec_to_goal, objp, robptr->turn_time[Difficulty_level]);
|
||||
|
||||
rate = robptr->turn_time[Difficulty_level];
|
||||
ai_turn_towards_vector(norm_vec_to_goal, objp, rate);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue