-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding ability to pause individual aircraft #114
Adding ability to pause individual aircraft #114
Conversation
Update from head fork 7/5/17
Adds new cases such that: 0: Unpauses all a/c 1: Pauses all a/c 2: Switches case for all a/c 100:119: Pauses a/c 0:19 200:219: Unpauses a/c 0:19 Updates log messages. Keeps the 0,1,2 arguments as they previously were.
xpcPlugin/MessageHandlers.cpp
Outdated
@@ -573,7 +573,7 @@ namespace XPC | |||
|
|||
if (aircraftNumber > 0) | |||
{ | |||
// Enable AI for the aircraftNumber we are setting | |||
// Enable AI for the aircraftNumber we are setting: MRT COMMENT: ENABLE, OR DISABLE? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable is correct. Setting the override_planepath
dref disables AI (see this page). This is here to re-enable the AI after setting the position. It occurs to me that this could conflict if the user is manually disabling the AI, but that isn't a use-case that we have been asked to support yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, I see. I was looking for the AI disable within the code itself, which is why I was confused. This is a case that I'm actually looking to explore with my code. Not sure the plugin needs updating though, I just need to disable the AI after moving the a/c.
That could be something helpful to mention in the Wiki though. That the sendPOSI command automatically turns the AI autopilot back on.
xpcPlugin/MessageHandlers.cpp
Outdated
DataManager::GetIntArray(DREF_Pause, value, 20); | ||
value[v - 100] = 1; | ||
} | ||
else if ((v >= 200) && (v < 120)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v < 220
xpcPlugin/MessageHandlers.cpp
Outdated
else if ((v >= 200) && (v < 120)) | ||
{ | ||
DataManager::GetIntArray(DREF_Pause, value, 20); | ||
value[v - 100] = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v - 200
xpcPlugin/MessageHandlers.cpp
Outdated
else | ||
{ | ||
for (int i = 0; i < 20; ++i) | ||
{ | ||
value[i] = v; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove trailing whitespace
Looks good to me. Thank you very much for contributing! Resolves #112 |
As suggested by @jason-watkins in issue #112 , I added the capability to pause individual a/c in addition to keeping the original arguments. Now, as it stands, the pauseSim command should be able to accept arguments:
0: Unpause all a/c
1: Pause all a/c
2: Switch the pause state of all a/c
100:119: Pause a/c 0:19 individually
200:219: Unpause a/c 0:19 individually