422 Commits
Author SHA1 Message Date
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 c5a5dc9f5c Fix a few MSVC warnings 2023-11-05 12:57:59 +00: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
Gleb Mazovetskiy e090c8bf31 Extract some player attributes to data files 2023-09-17 14:49:12 +01:00
Gleb Mazovetskiy 5355146d51 Use structured bindings 2023-08-29 12:56:49 +01:00
ephphatha 14639cd096 Replace _pNextExper with getter method
No real need to persist this value
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
Gleb Mazovetskiy 8c1a847f41 Remove utils/stdcompat/string_view.hpp 2023-08-14 09:59:14 +01:00
Gleb Mazovetskiy c19bfe87fa Remove utils/stdcompat/algorithm.hpp 2023-08-14 01:54:29 +01:00
Gleb Mazovetskiy 74755c8be7 Remove utils/stdcompat/cstddef.hpp 2023-08-14 01:54:29 +01:00
ephphatha 4e3f46603a Remove unused attribute _pMaxLvl 2023-08-12 17:43:30 +02:00
Gleb Mazovetskiy 8101e2c0ba Add c_any_of and friends
Adds handy helpers for performing algorithms on the entire container.
They're prefixed with `c_` for container.

This naming convention is identical to some popular C++ libraries, such
as Abseil.
2023-08-12 16:24:01 +01:00
obligaron 0eda8d9367 Convert town portal level type to vanilla hellfire logic 2023-07-18 23:39:23 +02:00
Anders Jenbo 09595cde5e Only apply relevant oils in multiplayer 2023-07-10 22:09:16 +02:00
Anders Jenbo 8e7c29ecd3 Remove unused player property _pISplDur 2023-06-28 23:50:50 +02:00
Anders Jenbo 63277a842d Clean up player packing 2023-06-24 04:18:14 +02:00
staphen e39c19f85e Only sync monster animations after both monsters and missiles are loaded 2023-05-29 23:25:37 +02:00
staphen 60e3c32437 Sync monster animation data after loading Stone Curse missiles 2023-05-29 14:24:20 +02:00
staphen 5be3d76104 Validate item prices and revert oil effects in Diablo 2023-05-28 16:09:29 +02:00
obligaron aa354849ee Fix stone curse shows the wrong animation & infinite petrify 2023-05-28 11:19:42 +02:00
Gleb Mazovetskiy 4fa3732526 Add missing <cstdint> includes
Done with the following script:

```ruby
Dir["Source/**/*.{h,c,cc,cpp,hpp}"].each do |path|
  v = File.read(path)
  next if !v.include?("uint32_t") || v.include?("cstdint")

  lines = v.lines
  line_num = if lines[2].start_with?(" *")
    lines.index { |l| l.start_with?(" */") } + 3
  else
    3
  end

  lines.insert(line_num, "#include <cstdint>\n")

  File.write(path, lines.join(""))
end
```

then fixed-up manually
2023-05-10 13:50:12 +01:00
ephphatha 3a7ae732cd use unsigned types for item seeds 2023-05-06 18:02:54 +02:00
obligaron 2570c2d240 Don't recalculate player position when loading a game 2023-05-06 17:59:10 +02:00
Anders Jenbo 13b91b77fc Fix conversion of old automaps 2023-04-30 07:23:44 +02:00
Anders Jenbo 35442c8781 Fully skip dLight loading 2023-04-30 07:23:44 +02:00
staphen a74d041041 Reenable lights for active monsters when loading level 2023-04-26 03:18:52 +02:00
staphen 45da8b2295 Remove unique monster's light when no corpse is left behind 2023-04-25 19:16:44 +02:00
obligaron 7985a9211d Change Player::_pSplLvl to uint8_t 2023-04-24 18:19:27 +02:00
Anders Jenbo 12fa487cb5 Fix build 2023-04-24 17:57:11 +02:00
qndel d97f265cb1 light fix 2023-04-24 17:22:00 +02:00
Anders Jenbo e969a8ad01 Invert player to vision relation 2023-04-21 21:25:19 +02:00
Anders Jenbo a997f8d597 Only update vision in dungeon 2023-04-21 21:25:19 +02:00
Anders Jenbo 13c5c09990 Clean up Light related naming
A few are left unchanged as they will be removed in a later commit
2023-04-21 21:25:19 +02:00
Anders Jenbo ec9d1b5550 Rename _oLight to applyLighting 2023-04-19 19:41:10 +02:00
Anders Jenbo a1df95d580 Do not manipulate lights when saving and also correct save state 2023-04-19 07:53:36 +02:00
Anders Jenbo 779f16280c Consistently use uint8_t for lighting values 2023-04-18 23:53:04 +02:00
obligaron a0fca12d22 Only reset _oVar1 for dynamic lights 2023-04-18 21:29:54 +02:00
ThomasChr c91feb71f9 make light objects unseen when saving level change data, because level change data (instead of real save data) does not save light source and if the light objects will be marked as seen there lights won't be created and they stay dark 2023-04-18 15:27:18 +02:00
obligaron b87711bc08 Reintroduce Player::spellFrom to seperate teleport cursor from queued spell 2023-04-17 03:22:50 +02:00
Eric Robinson 81e3c7abaa Remove fixed bugfix comments, apply golem fix 2023-04-13 21:18:04 +02:00
obligaron eeca953615 Introduce UpdateHellfireFlag to set missing CF_HELLFIRE flag 2023-04-13 00:07:00 +02:00
Gleb Mazovetskiy 957bd03b98 Remove FMT_COMPILE in "cold" places
Removes most `FMT_COMPILE` calls.
`FMT_COMPILE` results in better performance but larger code size.

Removes `FMT_COMPILE` calls for places that are called infrequently,
i.e. not on every frame.

RG-99 binary size reduced by ~4 KiB.
2023-03-12 19:29:35 +01:00
Eric Robinson f75f66d54b Add playerdat (#5763) 2023-02-10 12:56:28 +00:00
Gleb Mazovetskiy 98294e0ad5 Optimize MissileData: 32 bytes -> 24
23 bytes used, 1 spare byte in the padding.
2023-02-07 08:08:04 +01:00
KPhoenix d813f13700 enum spell_id -> enum class SpellID 2023-02-05 10:24:58 +00:00
KPhoenix 7947b99511 Implement new enum class 2023-02-03 05:05:12 +01:00
Eric Robinson ef3a57b7d9 enum spell_type -> enum class SpellType (#5674) 2023-01-28 22:25:37 +01:00