Skip to content

Conversation

@NinjaSpectre
Copy link
Contributor

#1062

Add TubeFired to hardware events

if (parent->docking_state != DS_NotDocking) return;
if (parent->current_warp > 0.0) return;
if (state != WTS_Loaded) return;
has_fired = true;
Copy link
Owner

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)

Copy link
Contributor Author

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?

Copy link
Contributor Author

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;
Copy link
Owner

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.

@hemmond
Copy link
Contributor

hemmond commented Nov 22, 2020

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).

@NinjaSpectre
Copy link
Contributor Author

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.

@oznogon
Copy link
Contributor

oznogon commented Jan 4, 2026

Filed #2684 as a followup.

@daid daid closed this Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants