I am looking through CCommandAI and it's subclasses, attempting to clean them up, remove some bugs (the aircraft move acting like fight for one), and setting CAirCAI to inherit from CMobileCAI as apposed to CCommandAI.
I would also like to make an alt modifier on non-build commands append to the front of the queue (this would impact some functionality of the move command and so needs to be discussed).
The main purpose of this post, however, is to discuss CMD_SET_MAX_WANTED_SPEED. Currently, it affects:
All commands after it, if it is the last SetMaxWantedSpeed command, even if the queue is canceled before the command executes.
All commands prior to it if it is the first SetMaxWantedSpeed command. If the queue is canceled, it affects all new commands until an new SetMaxWantedSpeed command is added anywhere in the queue (I think).
All commands between it and the preceding SetMaxWantedSpeed command.
All of this seems too complicated to me. I would propose changing it so that it only changes the max wanted speed when it executes. Allowing an alt modifier to place it at the front of the queue would give flexibility similar to the current setup, with a simpler system.
Even if the current system is going to be kept, I'm going to rewrite the code so that it does not iterate through the command queue every slow update.
Changes to Command AI: CMD_SET_MAX_WANTED_SPEED
Moderator: Moderators
Resurrecting an old thread, I'm going to go ahead and make the change. I don't see enough reason not to. It only seems to be used in SelectedUnitsAI for formation moves. If it breaks some scripts, I can change it back.
P.S. My work on spring was temporally suspended by my team winning the World Series (that's baseball for those of you who don't follow American sports). A 3 hour game I felt compelled to watch most nights for the better part of a month.
EDIT: Ok, I read SetMaxWantedSpeed wrong. It only affects a single command directly in front of it, and does not iterate through he command queue (I was thrown by the use of an iterator). In conclusion, I will not be making any changes to SetMaxWantedSpeed.
P.S. My work on spring was temporally suspended by my team winning the World Series (that's baseball for those of you who don't follow American sports). A 3 hour game I felt compelled to watch most nights for the better part of a month.
EDIT: Ok, I read SetMaxWantedSpeed wrong. It only affects a single command directly in front of it, and does not iterate through he command queue (I was thrown by the use of an iterator). In conclusion, I will not be making any changes to SetMaxWantedSpeed.