Jump to content

Search the Community

Showing results for tags 'onstart'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements
    • Welcome Aboard
  • Kerbal Space Program 2
    • KSP2 Dev Updates
    • KSP2 Discussion
    • KSP2 Suggestions and Development Discussion
    • Challenges & Mission Ideas
    • The KSP2 Spacecraft Exchange
    • Mission Reports
    • KSP2 Prelaunch Archive
  • Kerbal Space Program 2 Gameplay & Technical Support
    • KSP2 Gameplay Questions and Tutorials
    • KSP2 Technical Support (PC, unmodded installs)
    • KSP2 Technical Support (PC, modded installs)
  • Kerbal Space Program 2 Mods
    • KSP2 Mod Discussions
    • KSP2 Mod Releases
    • KSP2 Mod Development
  • Kerbal Space Program 1
    • KSP1 The Daily Kerbal
    • KSP1 Discussion
    • KSP1 Suggestions & Development Discussion
    • KSP1 Challenges & Mission ideas
    • KSP1 The Spacecraft Exchange
    • KSP1 Mission Reports
    • KSP1 Gameplay and Technical Support
    • KSP1 Mods
    • KSP1 Expansions
  • Community
    • Science & Spaceflight
    • Kerbal Network
    • The Lounge
    • KSP Fan Works
  • International
    • International
  • KerbalEDU
    • KerbalEDU
    • KerbalEDU Website

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Skype


Twitter


About me


Location


Interests

Found 1 result

  1. Hello all! I am working on reverse-engineering a mod and I have run into an issue with my understanding of C#. The mod has this method: public class CivilianPopulationRegulator : BaseConverter { public override void OnStart(PartModule.StartState state) { if (!HighLogic.LoadedSceneIsFlight) { base.OnStart(state); return; } if (this.vessel == null) { base.OnStart(state); return; } //do some stuff later base.OnStart(state);//Not sure what this does at the moment. } } Looking at the "base" keyword, it is used to call a method in the base class that is being overriden or it is used to call a constructor. Unless OnStart is a constructor, isn't this going into the extended class (BaseConverter, which extends PartModule) and run OnStart again? At the end of which, OnStart will be called yet again. And so on infinitely? So since the code is not infinitely recursive, I must be mistaken in either my understanding of OnStart or the "base" keyword. Would any of you guys know why this works and/or where I could learn more about this?
×
×
  • Create New...