TrenchBroom / TrenchBroom

Cross-Platform Level Editor
kristianduske.com/trenchbroom
GNU General Public License v3.0
1.88k stars 224 forks source link

GameConfig.cfg with a single invalid fileformat causes nondescriptive error "Unknown error while saving .map" when saving #4471

Open hedgewizards opened 4 months ago

hedgewizards commented 4 months ago

System Information

Version 2023.1 on Windows 10

Expected Behavior

trenchbroom provides a more verbose error that the selected fileFormat is invalid. ideally, it does this when you create a new map instead of at the time the error currently appears (when saving)

Steps to Reproduce

Pogo3d.zip

  1. Add the above as a new game to trenchbroom (unzipping into %appdata%/TrenchBroom/games on windows)
  2. Create a new map for that game (pogo3D). The only option for FileFormat should be "Pogo3d" and it should be grayed out
  3. save document anywhere

Error

Trenchbroom spawns an error that says "Unknown error while saving (map name)". there is no context. nothing appears in the logs. the file is successfully written and contains only this:

// Game: Pogo3D
// Format: Unknown
eGax commented 4 months ago

TrenchBroom has no idea what a Pogo3D map format is.


    "version" : 6,
    "name" : "Pogo3D",
    "icon": "Icon.png",
    "fileformats": [
        { "format": "Pogo3D" }
    ],
eGax commented 4 months ago

Supported map formats :

{ "format": "Quake2" } { "format": "Quake2 (Valve)"} { "format": "Valve" } { "format": "Standard" } { "format": "Quake3 (Valve)" } { "format": "Quake3 (legacy)" } { "format": "Daikatana" }

hedgewizards commented 4 months ago

yeah. I know pogo3D is not a real map format. it was just a mistake when creating the config. I think trenchbroom should be smart enough to warn the user they have made this mistake though