Skip to content

Follow up to #701 #711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

winterheart
Copy link
Collaborator

Pull Request Type

  • GitHub Workflow changes
  • Documentation or Wiki changes
  • Build and Dependency changes
  • Runtime changes
    • Render changes
    • Audio changes
    • Input changes
    • Network changes
    • Other changes

Description

Current -mission cmdline arg handling is broken. Intended use is direct load specified mission, but currently it fails with Int3().

Now Descent3 loads specified mission after selecting pilot and pressing "New game" in main menu.

Simplified code around direct loading missions.

Related Issues

Screenshots (if applicable)

Checklist

  • I have tested my changes locally and verified that they work as intended.
  • I have documented any new or modified functionality.
  • I have reviewed the changes to ensure they do not introduce any unnecessary complexity or duplicate code.
  • I understand that by submitting this pull request, I am agreeing to license my contributions under the project's license.

Additional Comments

@Lgt2x
Copy link
Member

Lgt2x commented May 23, 2025

This conflicts with #701 that takes a different approach. Yours will load the mission every time you select "New game", mine will load the level automatically once the pilot is selected, but only the first time. My use case for -mission is easily testing a level without any interaction on the menu before entering it, using a command-line like -pilot mypilot -mission d3 -loadlevel 4, but still give full access to the game once it has loaded once. TBH I'm fine with both.

@winterheart
Copy link
Collaborator Author

Oh, I didn't aware that there already #701 in PRs. Still, second commit still maybe useful.

@Lgt2x
Copy link
Member

Lgt2x commented May 23, 2025

haha I thought you just didn't like the way I did it. Let's keep the 2nd commit

@winterheart
Copy link
Collaborator Author

Reworked PR after #701 merged.

@winterheart winterheart changed the title Fix handling -mission cmdline arg Follow up to #701 Jun 3, 2025
@@ -509,7 +509,7 @@ int LGSMission(const char *msnname, int level) {
mng_LoadAddonPages();

InitPlayerNewShip(Player_num, INVRESET_ALL);
InitCameraViews(1); // Turn off all camera views, including rear views
InitCameraViews(true); // Turn off all camera views, including rear views
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are other instances left using an int argument out there in gamesequence.cpp if you mind fixing as well

FirstGame = false;
#ifdef OEM
if (LoadMission(OEM_MISSION_FILE))
mission_name = OEM_MISSION_FILE;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find the d3oem.mn3 anywhere, we could even delete the #ifdef OEM I think (and even DEMO?)

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.

2 participants