mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 05:09:20 +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:
@@ -1014,7 +1014,12 @@ whois_event::deserialize_( cParser &Input, scene::scratch_data &Scratchpad ) {
|
|||||||
void
|
void
|
||||||
whois_event::run_() {
|
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 ) {
|
for( auto &target : m_targets ) {
|
||||||
auto *targetcell { static_cast<TMemCell *>( std::get<scene::basic_node *>( target ) ) };
|
auto *targetcell { static_cast<TMemCell *>( std::get<scene::basic_node *>( target ) ) };
|
||||||
|
|||||||
Reference in New Issue
Block a user