Skip to content
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

Maps are not be saved when created with DOOMEdit if the "." is in the file path. #299

Closed
TommyHanusa opened this issue Jul 19, 2020 · 5 comments

Comments

@TommyHanusa
Copy link

TommyHanusa commented Jul 19, 2020

On Windows 10 64-bit when saving a map created with DoomEdit no file will be generated.

Repro steps:

  1. Launch Dhewm3 1.5.1rc1 DOOMEdit with a shortcut using a shortcut targeted to "YOURPATH\dhewm3\dhewm3.exe" +set r_fullscreen 0 +set r_multiSamples 0 +editor
  2. Create a box map.
  3. Select File>Save to save the map, enter any valid name.
  4. Select File>Open to open the map, it will not be available.

Notes:
This does not occur in the original Doom3 DOOMEdit, the map is saved properly (although an error message is generated, the map saves properly).

To make a box map:

  1. In the Inspectors window select the Media tab (lower left corner) and navigate to Textures>textures>basefloor and select a_bluetex1a_02 from the top of the list.
  2. In the right 'grid' window click and drag create a ~256 unit brush on each side.
  3. Press ctrl+tab to cycle the view, click outside the brush (red box) and drag so its height is ~256 units.
  4. In the menu bar, use Selection>CSG>Hollow to make it into a room.
  5. In the right 'grid' window, right click and select the light entity and position it where the 'center' is inside the box. Use ctrl+tab to ensure it is in the room (the j key can be used to further configure the light).
  6. In the right 'grid' window, right click and select the info>info_player_start entity inside the box (must not be inside any brushes). Use ctrl+tab to ensure it is in the room.
  7. This map can be compiled with the "dmap mapname" command and then run with the "map mapname" command.
@TommyHanusa
Copy link
Author

It appears this happens with any map that is saved DOOMEdit, not just maps missing the .map post-fix (as was previously stated.

@TommyHanusa
Copy link
Author

Note: The File>Save Selected command functions properly?

@TommyHanusa
Copy link
Author

As a note, #301 had an issue with a period in the file path, that is likely the root cause of this issue as well.

DanielGibson added a commit that referenced this issue Jul 21, 2020
idStr::StripFileExtension() (and SetFileExtension() which uses it) and
others didn't work correctly if there was a dot in a directory name,
because they just searched from last to first char for '.', so if the
current filename didn't have an extension to cut off, they'd just cut off
at any other '.' they found.
So D:\dev\doom3.data\base\maps\bla could turn into D:\dev\doom3
(or, for SetFileExtension(), D:\dev\doom3.map)

While at it, I made most of the idStr code that explicitly checked for '\\'
and '/' (and maybe ':' for AROS) use a little "bool isDirSeparator(int c)"
function so we don't have the #ifdefs for different platforms all over
the place.
DanielGibson added a commit that referenced this issue Jul 21, 2020
idStr::StripFileExtension() (and SetFileExtension() which uses it) and
others didn't work correctly if there was a dot in a directory name,
because they just searched from last to first char for '.', so if the
current filename didn't have an extension to cut off, they'd just cut off
at any other '.' they found.
So D:\dev\doom3.data\base\maps\bla could turn into D:\dev\doom3
(or, for SetFileExtension(), D:\dev\doom3.map)

While at it, I made most of the idStr code that explicitly checked for '\\'
and '/' (and maybe ':' for AROS) use a little "bool isDirSeparator(int c)"
function so we don't have the #ifdefs for different platforms all over
the place.
@TommyHanusa
Copy link
Author

This issue no longer reproduces in dhewm3_1.5.1_RC1-editorfixes2_win32.zip

@TommyHanusa TommyHanusa changed the title Maps are not be saved when created with DOOMEdit if the .map post-fix is not provided. Maps are not be saved when created with DOOMEdit if the "." is in the file path. Jul 21, 2020
@TommyHanusa
Copy link
Author

bug is still closed, changing the actual name to make it more clear in case of regressions.

rorgoroth pushed a commit to rorgoroth/dhewm3 that referenced this issue Apr 8, 2023
idStr::StripFileExtension() (and SetFileExtension() which uses it) and
others didn't work correctly if there was a dot in a directory name,
because they just searched from last to first char for '.', so if the
current filename didn't have an extension to cut off, they'd just cut off
at any other '.' they found.
So D:\dev\doom3.data\base\maps\bla could turn into D:\dev\doom3
(or, for SetFileExtension(), D:\dev\doom3.map)

While at it, I made most of the idStr code that explicitly checked for '\\'
and '/' (and maybe ':' for AROS) use a little "bool isDirSeparator(int c)"
function so we don't have the #ifdefs for different platforms all over
the place.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant