Author Topic: Fix after burner traces  (Read 1367 times)

0 Members and 1 Guest are viewing this topic.

Offline pedro

  • 23
Fix after burner traces
Hello everybody.

That's my very first post here. karajorma told me to fix this bug about afterburners messages: http://scp.indiegames.us/mantis/bug_view_advanced_page.php?bug_id=1982. I would like to debate the fix, and get help to validate & deliver the code.

An AI could have different strategies when the controlled ship have afterburners or not. I think an IA should never try (and fail) to use after burner on a ship which is not equipped because it encourages the IA to pilot every ship the same way. That's why I propose to continue the karmajora correction by adding ai_maybe_fire_afterburner call every time it's necessary.

Here is my proposition:
1- afterburners_start modified bails with a warning message "Ship type %s does not have afterburners". The check is moved before the snd_play statement. The warning will help to detect earlier, abusive call to afterburner_start. Note that when a player start the afterburner on an unequipped ship,afterburners_start is never called, so there will be no warning logged.
2- afterburners_stop modified to bails with a warning message "Ship type %s does not have afterburners" according to Sushi_CW comment.
3- IA never start afterburner when ai_maybe_fire_afterburner return 0. Theses modifications causes IA to use less the afterburned. For instance ia of class 0 never use the afterburner.
3.1 - evade_ship() modified to check ai_maybe_fire_afterburner
3.2 - ai_big_strafe_glide_attack() modified to check ai_maybe_fire_afterburner
(I have an svn patch available, if needed.)

I don't know how to be sure the IA change behavior does not introduce new bugs. What do you think about it ?

I addition, I don't know how to reproduce the incident on my computer in order to check the correction.

Thanks for your help.

  

Offline pedro

  • 23
Re: Fix after burner traces
This topic should not be used anymore.
The discussion has moved to mantis : see http://scp.indiegames.us/mantis/view.php?id=1982