17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 08:39:19 +02:00

whois: log the no-activator case instead of failing silently

A whois with no triggering vehicle previously just wrote nothing to
the target cell with no trace in the log, which is a real pain to
diagnose from the scenery side (this is exactly the kind of thing that
cost real debugging time on a station script recently).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Piotr Warszawski
2026-09-04 22:22:25 +02:00
parent 7ead4f11b4
commit 1ce576c0c6

View File

@@ -1014,7 +1014,12 @@ whois_event::deserialize_( cParser &Input, scene::scratch_data &Scratchpad ) {
void
whois_event::run_() {
if( m_activator == nullptr ) { return; }
if( m_activator == nullptr ) {
// no triggering vehicle to report on - most likely whois was launched from a
// scenery event chain rather than a track/isolation crossing
WriteLog( "Type: WhoIs (" + std::to_string( m_input.flags ) + ") - no activator, event ignored" );
return;
}
for( auto &target : m_targets ) {
auto *targetcell { static_cast<TMemCell *>( std::get<scene::basic_node *>( target ) ) };