Gleb Mazovetskiy
d07ac14440
Handle nullptr localtime
...
`localtime` can return `nullptr` on some platforms (e.g. NXDK)
Improve portability by handling the `nullptr` result.
4 years ago
Gleb Mazovetskiy
39ff1825c1
drlg_l2.cpp: Fix `-Wmissing-braces` from clang
4 years ago
Gleb Mazovetskiy
ac15c3bbb4
MpqWriter: No `std::ios::in` for new archives
4 years ago
Gleb Mazovetskiy
a23ad0113b
MpqWriter constructor: Better error message
4 years ago
Gleb Mazovetskiy
a1aed18c8b
ReadOnlyTest: Use "w" mode instead of "wt"
...
There is no reason to open that file in text mode explicitly
4 years ago
Gleb Mazovetskiy
bfc5639e6b
Fix DVL_EXCEPTIONS on clang
4 years ago
Mikołaj Piróg
15989609a8
Members' name changes and comments in Monster struct ( #4861 )
4 years ago
Cesar Canassa
de971c6a8b
♻️ Refactor AddMonster to return a monster pointer ( #4894 )
4 years ago
obligaron
3c571bf64b
Avoid overflow of tickCounterOfCurrentFrame ( #4893 )
...
* When MFLAG_ALLOW_SPECIAL is set, don't call processAnimation (avoid overflow of tickCounterOfCurrentFrame)
4 years ago
aetn23
bf568fe480
Remove assert to check if value is in bounds
4 years ago
Cesar Canassa
0d106beaf3
♻️ Refactor M_StartHit to receive a Monster reference
4 years ago
Cesar Canassa
b1275d0163
Renamed m variable into monsterId
4 years ago
Cesar Canassa
443f88b0f7
Rename MonsterTrapHit m parameter to monsterId
4 years ago
Mikołaj Piróg
dda0b96ea5
Remove #defines in player.h and add constexpr where applicable ( #4896 )
...
* Change defines to constexpr int in player.h
* Add const or constexpr to player.h/cpp where applicable
* Update tests with changed names of player constatns
* remove unecessary variable
4 years ago
Cesar Canassa
dab0517f21
♻️ Refactor ActivateSpawn to receive a Monster reference ( #4889 )
4 years ago
Cesar Canassa
423a2ed614
♻️ Refactor MonsterRangedAttack to receive a Monster reference ( #4891 )
4 years ago
Cesar Canassa
27f8951a94
♻️ Refactor MonsterWalk to receive a Monster reference ( #4888 )
4 years ago
Cesar Canassa
4bb2f30657
♻️ Refactor MonsterDeath to receive a Monster reference ( #4887 )
4 years ago
Cesar Canassa
76da2d14c9
Remove monsterId from M_GetKnockback ( #4882 )
4 years ago
Gleb Mazovetskiy
aeb8f9ee91
points_in_rectangle_range.hpp: Fix line endings
4 years ago
Gleb Mazovetskiy
eb8721885d
Fix clang warnings
...
As seen in the Xbox NDK build.
4 years ago
obligaron
4db1c6f315
Make DirectionSettings::offset match ActorPosition::offset2 ( #4883 )
4 years ago
Cesar Canassa
c126839b9f
♻️ Refactor StartMonsterGotHit to receive a Monster reference ( #4880 )
4 years ago
Cesar Canassa
bbb78542df
♻️ Refactor Teleport to receive a Monster reference instead of monsterId ( #4879 )
4 years ago
Anders Jenbo
0b7ad34c9d
Take player by reference in StartWalkStand and RemovePlrMissiles ( #4874 )
4 years ago
Cesar Canassa
79f5cdb2be
♻️ change delta_monster_hp to receive a Monster reference ( #4873 )
4 years ago
Stephen C. Wills
4584b41d69
Fix errors rendering progress dialog ( #4878 )
4 years ago
Cesar Canassa
6579aa53c5
Normalise the player and monster walking function naming ( #4877 )
...
Both player and monster walking functions are not named WalkNorthwards, WalkSouthwards and WalkSideways.
Also renames the PLT_MODE enum to follow the same pattern and removes the comments that are now unnecessary
4 years ago
ephphatha
fce4d23ba8
Iterate over all monsters when applying delta
4 years ago
ephphatha
2da2ea7b03
Take monster reference in M_ClearSquares
4 years ago
Cesar Canassa
eb2740c7b6
♻️ change M_WalkDir to receive a Monster reference ( #4875 )
4 years ago
k-bar
26de74f4a2
AnimationInfo class correct style ( #4870 )
...
* AnimationInfo class correct case-style for private members
clang-tidy warnings:
readability-identifier-naming invalid case style for private member
* AnimationInfo class correct case-style for members
clang-tidy warnings:
readability-identifier-naming invalid case style for member
* AnimationInfo class correct case-style for methods
clang-tidy warnings:
readability-identifier-naming invalid case style for method
* AnimationInfo class use nodiscard
clang-tidy warnings:
modernize-use-nodiscard function should be marked [[nodiscard]]
4 years ago
Cesar Canassa
746abaaacb
Improve StartWalkX functions naming ( #4872 )
4 years ago
Cesar Canassa
fa62ff75e3
♻️ Get the moster ID dynamically ( #4820 )
...
Converts the StartWalk functions to receive the monster struct instead of monsterId
4 years ago
Gleb Mazovetskiy
17f8cdddc4
Clean up `GetSpellLevel`
...
Remove the buggy `GetSpellLevel` implementation and use
`Player#GetSpellLevel` throughout instead.
4 years ago
Gleb Mazovetskiy
6949a6f418
Monster: Remove MType/MData pointers
...
These pointers are redundant, replaces them with methods.
4 years ago
Gleb Mazovetskiy
495448c460
Fix extra bracket in (disabled) translation
4 years ago
Gleb Mazovetskiy
966e66e88e
.clang-tidy: -misc-non-private-member-variables-in-classes
...
Following the discussion in the chat
4 years ago
Gleb Mazovetskiy
d152d2c0fb
Add OptionalOwnedCelSprite
4 years ago
Gleb Mazovetskiy
21dc7f553d
Add OptionalCelSprite: smaller than std::optional
...
`CelSprite` data pointer can never be `nullptr`.
We implement a smaller `optional` for it by taking advantage of that.
4 years ago
obligaron
a6132a1aa8
Ensure that no overflow happens when loading (invalid) data
4 years ago
obligaron
e87aca38bb
Change animation frames and tick per frame to int8_t
4 years ago
obligaron
d4638f290c
Don't call player.AnimInfo.ProcessAnimation if player death animation is finished
4 years ago
Anders Jenbo
ab55877adc
Take player by reference in UseMana
4 years ago
Anders Jenbo
b00ae287b8
Minimize propegation of global Players index
4 years ago
Gleb Mazovetskiy
92b6be4302
Fix `Point#*Distance` functions for unsigned types ( #4857 )
...
The `-` converts everything to unsigned if one of the operands is
unsigned. Convert everything to int before calculating.
4 years ago
ephphatha
0f1ac758d8
use a smaller buffer
...
fmt::memory_buffer uses 500 bytes by default, go back to a 12 byte char array to avoid all the cruft
4 years ago
ephphatha
d6120f05bc
Only call fmt::format_to when the FPS value updates
...
Don't even need to initialise the buffer since the last update time is set when DiabloInit is called, then as long as the loading screen takes more than a second the threshold gets hit to call format_to on the first frame of gameplay.
4 years ago
k-bar
21b6365589
missile from berserked monster try to hit every monster
4 years ago
Andrew James
ace09d5f45
Address int-arithmetic-overflow in loadsave.cpp ( #4853 )
4 years ago