Looks good overall. A couple of nitpicks/questions:
- if ( goal_vel.xyz.z < -pi->max_rear_vel )
+ if ( goal_vel.xyz.z < -pi->max_rear_vel && !(pi->flags & PF_AFTERBURNER_ON) )
goal_vel.xyz.z = -pi->max_rear_vel;
Maybe it would make sense here to cap the rear velocity to afterburner_max_reverse_vel when appropriate instead? The fact that we are essentially removing a check when afterburner is on without explicitly handling the new case makes me a bit nervous.
+ goal_vel.xyz.z = ci->forward* pi->afterburner_max_vel.xyz.z;
+ if(ci->forward < 0.0f){
+ goal_vel.xyz.z = ci->forward* pi->afterburner_max_reverse_vel;
+ }
This works, but it's probably better to only assign once. In other words, format this as an if/else or as a ? : ternary.
ramp_time_const = pi->forward_decel_time_const;
- // hmm, maybe a reverse_accel_time_const would be a good idea to implement in the future...
+ if ( pi->flags & PF_AFTERBURNER_ON )
+ ramp_time_const = pi->afterburner_reverse_accel;
Same thing here.
+ /* SparK 2010-01-18: this guy is buggin me out, I need reverse burners to be an option.
// AL 12-29-97: If afterburner key is down, player should have full forward thrust (even if afterburners run out)
if ( check_control(AFTERBURNER) ) {
ci->forward = 1.0f;
}
+ */
Don't comment this out. If it really is unneeded logic that is already duplicated in physics.cpp, then just cut it out completely.
- dest_ci->forward_cruise_percent = 0.0f;
- dest_ci->fire_countermeasure_count = 0;
- dest_ci->fire_secondary_count = 0;
- dest_ci->fire_primary_count = 0;
- dest_ci->forward_cruise_percent = src_ci->forward_cruise_percent;
- dest_ci->fire_countermeasure_count = src_ci->fire_countermeasure_count;
- dest_ci->fire_secondary_count = src_ci->fire_countermeasure_count;
- dest_ci->fire_primary_count = src_ci->fire_countermeasure_count;
Why are you removing these lines?