-
Notifications
You must be signed in to change notification settings - Fork 211
Add weapon tube fired event #1066
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
Conversation
| if (parent->docking_state != DS_NotDocking) return; | ||
| if (parent->current_warp > 0.0) return; | ||
| if (state != WTS_Loaded) return; | ||
| has_fired = true; |
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.
This won't work properly on clients (as the fire function is only called on the server)
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.
I guess I'm missing something here as I don't see why the client should be allowed to set this value at all. Perhaps the entire function should be guarded inside a if (game_server) check?
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.
Obviously I didn't initially comprehend what you meant.... I can be a bit daft sometimes...
| bool WeaponTube::hasFired() | ||
| { | ||
| bool flag = has_fired; | ||
| if (has_fired) has_fired = false; |
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.
It's very implicit behavour that a "hasFired" function resets the flag as well. Not saying I have a better solution, but it's not clear from the function name that calling it will change internal state of the weapon tube.
|
I'm wondering why do we need info if a tube has fired. It it is for mission scripting, I would think it would be better to have a callback function to be called when tube (or any tube on ship) fired. So it will simply run a callback (or nil) on every missile launch (or until callback has been set back to nil). |
|
This is to have a software trigger so that a Digital Multiplex (DMX) controller can be used to display when a weapon tube has been fired. Currently there is only a trigger for when a tube is constantly firing, a condition that only happens when HVLI missiles are fired. |
225ab9f to
b81b89d
Compare
|
Filed #2684 as a followup. |
#1062
Add
TubeFiredto hardware events