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

Air units should no longer damage self or friendly units #592

Merged

Conversation

stefanhendriks
Copy link
Owner

No description provided.

- so that it won't crash when air unit does not exist, the follow-up code assumes when 'true' is returned that a unit is present.
- for #361
@stefanhendriks stefanhendriks force-pushed the bugfix/361/ornithopters-should-not-friendly-fire branch from c2e3aa0 to 952a300 Compare November 10, 2024 20:37
@stefanhendriks
Copy link
Owner Author

Build fails for mingw32. On my machine it works, this is what the configure step produces for me:

shendriks@stefan /c/projects/fundynamic/Dune-II---The-Maker/build (bugfix/361/ornithopters-should-not-friendly-fire) $ cmake .. -G "MinGW Makefiles"
-- The C compiler identification is GNU 12.1.0
-- The CXX compiler identification is GNU 12.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/mingw32/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/mingw32/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_RC_COMPILER: C:/msys64/mingw32/bin/windres.exe
-- Found PkgConfig: C:/msys64/mingw32/bin/pkg-config.exe (found version "1.8.0")
-- Guessed MinGW directory: C:/msys64/mingw32
-- CMAKE_INSTALL_PREFIX: C:/msys64/mingw32
-- Found DDraw: C:/msys64/mingw32/include
-- Found DInput: C:/msys64/mingw32/include
-- Found DSound: C:/msys64/mingw32/include
-- Found DXGuid: C:/msys64/mingw32/lib/libdxguid.a
-- Found OpenGL: opengl32
-- Found ZLIB: C:/msys64/mingw32/lib/libz.dll.a (found version "1.2.12")
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
-- Could NOT find Vorbis (missing: OGG_INCLUDE_DIR Vorbis_INCLUDE_DIR OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY)
-- Module support is disabled.
-- Version: 8.0.1
-- Build type:
-- CXX_STANDARD: 20
-- Performing Test has_std_20_flag
-- Performing Test has_std_20_flag - Success
-- Performing Test has_std_2a_flag
-- Performing Test has_std_2a_flag - Success
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS - Success
-- Performing Test FMT_HAS_VARIANT
-- Performing Test FMT_HAS_VARIANT - Success
-- Required features: cxx_variadic_templates
-- Looking for _strtod_l
-- Looking for _strtod_l - found
-- Performing Test FMT_HAS_MBIG_OBJ
-- Performing Test FMT_HAS_MBIG_OBJ - Failed
-- Configuring done
-- Generating done
-- Build files have been written to: C:/projects/fundynamic/Dune-II---The-Maker/build

Build then works fine.

I see this is a bit different in the CI pipeline:

Run cd "D:\a\Dune-II---The-Maker\Dune-II---The-Maker"
  cd "D:\a\Dune-II---The-Maker\Dune-II---The-Maker"
  mkdir build
  cd build
  cmake .. -G "MinGW Makefiles"
  shell: D:\a\_temp\setup-msys[2](https://github.com/stefanhendriks/Dune-II---The-Maker/actions/runs/11768323222/job/32778016409?pr=592#step:4:2)\msys2.CMD {0}
  env:
    MSYSTEM: MINGW32
-- The C compiler identification is GNU 14.2.0
-- The CXX compiler identification is GNU 14.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/a/_temp/msys64/mingw[3](https://github.com/stefanhendriks/Dune-II---The-Maker/actions/runs/11768323222/job/32778016409?pr=592#step:4:3)2/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/a/_temp/msys6[4](https://github.com/stefanhendriks/Dune-II---The-Maker/actions/runs/11768323222/job/32778016409?pr=592#step:4:4)/mingw32/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- CMAKE_RC_COMPILER: D:/a/_temp/msys[6](https://github.com/stefanhendriks/Dune-II---The-Maker/actions/runs/11768323222/job/32778016409?pr=592#step:4:6)4/mingw32/bin/windres.exe
-- Found PkgConfig: D:/a/_temp/msys64/mingw32/bin/pkg-config.exe (found version "2.3.0")
-- Guessed MinGW directory: D:/a/_temp/msys64/mingw32
-- CMAKE_INSTALL_PREFIX: D:/a/_temp/msys64/mingw32
-- Found DDraw: D:/a/_temp/msys64/mingw32/include
-- Found DInput: D:/a/_temp/msys64/mingw32/include
-- Found DSound: D:/a/_temp/msys64/mingw32/include
-- Found DXGuid: D:/a/_temp/msys64/mingw32/lib/libdxguid.a
-- Found OpenGL: opengl32
-- Found ZLIB: D:/a/_temp/msys64/mingw32/lib/libz.dll.a (found version "1.3.1")
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR) 
-- Could NOT find Vorbis (missing: OGG_INCLUDE_DIR Vorbis_INCLUDE_DIR OGG_LIBRARY VORBIS_LIBRARY VORBISFILE_LIBRARY) 
-- Module support is disabled.
-- Version: [8](https://github.com/stefanhendriks/Dune-II---The-Maker/actions/runs/11768323222/job/32778016409?pr=592#step:4:8).0.1
-- Build type: 
-- CXX_STANDARD: 20
-- Performing Test has_std_20_flag
-- Performing Test has_std_20_flag - Success
-- Performing Test has_std_2a_flag
-- Performing Test has_std_2a_flag - Success
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS - Success
-- Performing Test FMT_HAS_VARIANT
-- Performing Test FMT_HAS_VARIANT - Success
-- Required features: cxx_variadic_templates
-- Looking for _strtod_l
-- Looking for _strtod_l - found
-- Performing Test FMT_HAS_MBIG_OBJ
-- Performing Test FMT_HAS_MBIG_OBJ - Failed
-- Configuring done (4.1s)
-- Generating done (0.2s)
-- Build files have been written to: D:/a/Dune-II---The-Maker/Dune-II---The-Maker/build

@stefanhendriks
Copy link
Owner Author

The easiest way to deal with this is to disable this warning, using -Wno-dangling-reference, taken from https://stackoverflow.com/questions/78759847/gcc-14-possibly-dangling-reference-to-a-temporary-warning-or-not-depending-on

@stefanhendriks stefanhendriks merged commit 598669c into master Nov 10, 2024
2 checks passed
@stefanhendriks stefanhendriks deleted the bugfix/361/ornithopters-should-not-friendly-fire branch November 10, 2024 22:25
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.

1 participant