215 Commits
Author SHA1 Message Date
Gleb MazovetskiyandClaude Sonnet 5 92927ca913 Migrate ClassAttributes, player HP/mana, item HP/mana bonuses, and monster HP to Fixed10_6/Fixed26_6
Replaces ParseFixed6/parseFixed6/readFixed6/readDecimal's raw-int
plumbing with the new FixedPoint type, then propagates strongly-typed
fixed-point fields through everywhere that consumed them: player
_pHitPoints/_pMana (and their base/max variants), ClassAttributes'
percentage/multiplier fields, Item::_iPLHP/_iPLMana, and
Monster::hitPoints/maxHitPoints. Eliminates manual <<6/>>6 bit-shifting
at nearly every call site in favor of fromInt/fromRaw/whole() and the
new fixed-point arithmetic operators, while preserving raw() only at
genuine serialization/network wire-format boundaries.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-10-11 21:55:08 +01:00
Roman Stingler b4dfc8d265 Fix OOB read from unterminated player names in save/network data 2026-07-27 14:34:57 -04:00
Gleb MazovetskiyandClaude Fable 5 ac2d7fc731 Replace libfmt with std::format
- `fmt::format` with literal format strings -> `std::format`.
- `fmt::format(fmt::runtime(...))` -> `FormatRuntime` in the new
  `utils/format.hpp`, a std::vformat wrapper that is also safe under the
  P2905 lvalue requirement of `std::make_format_args`.
- `fmt::dynamic_format_arg_store` (Lua logging) -> a small hand-rolled
  per-field formatter over `std::variant`, returning `std::expected`.
- `fmt::format_int` -> `std::to_chars`.
- `fmt::join` -> manual joins at the two call sites.
- SDL_audiolib: new patch that rewrites aulib_log.h to use std::format
  and drops the fmt dependency from its CMakeLists.
- The `-static-libstdc++` guard now keys off
  `DEVILUTIONX_STATIC_SDL_AUDIOLIB` instead of `DEVILUTIONX_STATIC_LIBFMT`.
- libfmt removed from CMake, vcpkg, Brewfile, CI workflows,
  Dockerfiles, packaging scripts, UWP project, and docs.
- macOS bumped to 13.3+, iOS to 16.3+ (required for `<format>`)
- Amiga m68k: provide `__cmpdf2`, which is missing from the hard-float
  libgcc multilib but referenced via libstdc++'s long double paths.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-22 00:00:04 +02:00
Gleb Mazovetskiy 34c4cfc2e7 Add missing <fmt/format.h> includes 2026-06-29 17:00:01 +01:00
Anders Jenbo 005e7dcc23 chore: clang-tidy cleanup part 1 2026-04-03 22:57:48 +02:00
Yuri Pourre 5a08031caf [Bugfix] Update players directions on joining (#8462) 2026-03-09 21:01:52 -04:00
Eric Robinson 5937734b85 Move *dat files to tables dir 2026-01-05 20:14:23 +01:00
staphen 942bebb664 Fix warnings about mismatched sign in comparisons 2025-10-26 00:30:16 +02:00
Gleb Mazovetskiy 842b23803f SDL3: Use endianness swap helpers throughout 2025-10-09 01:28:37 +01:00
Andrettin f6b4665e94 Make Player Class Data Data-Driven (#8167) 2025-09-05 11:30:01 +02:00
Andrettin 528c1ad0e6 Use the size of the AllItemsList vector instead of IDI_LAST for getting how many items are there 2025-08-21 03:03:19 +02:00
Anders Jenbo 1c76897f2c Apply simple const rules using clang-tidy 2025-08-16 01:21:36 +02:00
Anders Jenbo 7b2de562c2 Extract more Hellfire into data 2025-07-21 00:42:33 +02:00
Yggdrasill 176819a072 Make RecreateItem() take whole dwBuff flag as argument (#7870) 2025-03-21 15:16:39 +00:00
staphen ec9f8ff685 Fix issue with Hellfire items morphing when transferred to Diablo 2025-03-06 17:18:22 +01:00
Gleb Mazovetskiy d7647d6c63 More dependency untangling
1. Moves more assets-related stuff from `init` to `engine/assets`.
2. Removes `SDL_audiolib` dependency from `soundsample.h`.
3. Cleans up some unused/missing includes.
2025-01-09 18:19:44 +00:00
Gleb Mazovetskiy b76feb2be3 Extract game mode out of init.cpp
Untangles some dependencies
2025-01-09 11:02:19 +00:00
Gleb Mazovetskiy dd76f17e4b Rename endian.hpp to endian_read.hpp
Following #7620, which split the write functions into a separate header.
2025-01-08 17:38:36 +09:00
Gleb Mazovetskiy a49b1f2d58 Extract Is{Any,None}Of out of engine.hpp
Untangles some of the dependencies
2025-01-08 09:54:56 +09:00
Eric Robinson cfac786daf Make invalid items unusable (#7506) 2024-11-15 04:59:40 +01:00
Eric Robinsonandstaphen a30f7c0b8e Randomize Unique Item Generation (Reverse compatible) (#7060)
Co-authored-by: staphen <[email protected]>
2024-06-19 01:20:15 +02:00
Eric Robinson 557fd2a4a3 Fix illegal spell levels (#7112) 2024-05-10 13:53:42 +02:00
KPhoenix 1c4166ce46 fix hp validation 2024-04-06 22:12:27 +02:00
staphen ab601eeb11 Apply Hellfire spellbook validation to PItem packet handling 2024-02-13 02:06:28 +01:00
KPhoenix b8738ab4cf Validation: Validate Item Drop Packets 2023-11-20 06:37:52 +01:00
staphen c4792be763 Remove invalid items after loading heroitem data 2023-11-19 23:48:21 +01:00
staphen 293ad814e6 Restore packed item state when regenerating an item using heroitem data 2023-11-19 23:48:21 +01:00
Gleb Mazovetskiy 99fea0d1c5 Migrate unique monsters to data files 2023-11-10 17:44:45 +00:00
Gleb Mazovetskiy 17d5f05ada Fix some compilation warnings 2023-11-02 00:42:44 +00:00
Eric Robinsonandstaphen dac2e0318e Fix Item Validation (#6723)
Co-authored-by: staphen <[email protected]>
2023-10-19 09:34:09 +02:00
staphen e5f626ccf9 Fix edge cases for packing empty items 2023-09-21 11:40:51 +02:00
ephphatha 6a8f4b12da Get base block bonus from data struct instead of storing a copy 2023-09-20 05:49:54 +02:00
ephphatha 5d50b5520d Add PlayerData lookup helper to avoid manual casts
This lets us remove the PlayersData global, and we can use a helper in the player class for convenience.
2023-09-20 05:49:54 +02:00
staphen 7855dae582 Indicate network validation success or failure in iteminfo 2023-09-19 05:11:51 +02:00
Gleb Mazovetskiy e090c8bf31 Extract some player attributes to data files 2023-09-17 14:49:12 +01:00
staphen a151219b9b Don't validate creation flags on gold 2023-09-03 17:03:25 +02:00
Gleb Mazovetskiy af869ac732 Merge branch 'master' into dev-merged 2023-09-01 20:49:34 +01:00
staphen 4deae11871 Fix PlayerNetPack validation and tests 2023-08-27 21:34:38 +02:00
Eric Robinson 9995c00323 Validate Item Locations (#6427) 2023-08-27 18:22:24 +02:00
Anders Jenbo 15ed246239 Merge branch 'master' of github.com:diasurgical/devilutionX into development 2023-08-26 01:09:03 +02:00
ephphatha e6890cc5cc Move MaxCharacterLevel to playerdat and add helpers for the various uses 2023-08-24 05:46:44 +02:00
ephphatha da76e131e4 Add getter/setter for character levels to ensure _pNextExper stays synced 2023-08-24 05:46:44 +02:00
ephphatha d92d152576 Use unsigned type for character levels 2023-08-24 05:46:44 +02:00
Stephen C. Wills 7b06703842 Add tests for net player validation (#6492) 2023-08-21 00:18:03 +02:00
Gleb Mazovetskiy c19bfe87fa Remove utils/stdcompat/algorithm.hpp 2023-08-14 01:54:29 +01:00
staphen b43a8dc904 Fix empty item slot validation in UnPackNetItem() 2023-07-20 02:38:42 +02:00
Anders Jenbo b01670e1e4 Correct fields being validated 2023-07-17 04:23:22 +02:00
46824261f9 Validate iCreateInfo (#6377)
Co-authored-by: staphen <[email protected]>
Co-authored-by: Anders Jenbo <[email protected]>
Co-authored-by: Stephen C. Wills <[email protected]>
2023-07-17 04:17:26 +02:00
Stephen C. Wills f0f317e685 Log validation errors in UnPackNetPlayer() (#6363) 2023-07-14 20:07:42 +02:00
Anders Jenbo 97ee615a8a Avoid durability overflow when packing items. (#6342) 2023-07-10 23:08:34 +02:00