Elvas Tower: Crash because of casting error - Elvas Tower

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Crash because of casting error Rate Topic: -----

#1 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,998
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 28 January 2023 - 12:34 AM

Engmod reported this crash http://www.elvastowe...post__p__293599 in ORNYMG. The MSTSWagonViewer.cs code generating this crash is present also in the official testing release, that is:

            if (Car.BrakeSkid) // if car wheels are skidding because of brakes locking wheels up then stop wheels rotating.
            {
                if ( ((MSTSLocomotive)MSTSWagon).DriveWheelOnlyBrakes)
                {
                    distanceTravelledDrivenM = 0.0f;
                }
                else
                {
                    distanceTravelledM = 0.0f;
                    distanceTravelledDrivenM = 0.0f;
                }

            }


If MSTSWagon is a wagon and not a locomotive, the casting to MSTSLocomotive fails. I've temporarily generated a fix for ORNYMG, while I'd suggest that the author of this part of code analyzes the issue and solves it for the official releases.

#2 User is offline   steamer_ctn 

  • Open Rails Developer
  • Group: Status: Elite Member
  • Posts: 1,889
  • Joined: 24-June 11
  • Gender:Male
  • Country:

Posted 28 January 2023 - 09:26 PM

Hi Carlo,

Thanks for identifying this bug

I am away from my development system for a few weeks.

Could you put your suffix In the Unstable version, and I will look at it when I get back.

#3 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 6,998
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 29 January 2023 - 01:26 AM

OK, i've generated the temporary fix PR #798 that should be present in the Unstable release within short time.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users