1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00
Commit Graph

975 Commits

Author SHA1 Message Date
a8a6be7ac1 Fix potential compatibility with C++20 / C++23 mode
This fixes several issues with compatibility with C++20. C++23 was also
tested, but apparently it does not have any additional breaking changes
compared to C++20 (or we don't have those).

VCMI still uses C++17 as before - goal is only to make potential
transition easier.

There were 2 cases that are deprecated in C++20 that we use:
- Floating point operations on enums are deprecated
- `this` can no longer be captured when using default capture by value
`[=]`

Both of those should now be replaced with code that works fine in both C+
+17 and in C++20 mode
2025-03-02 14:11:48 +00:00
0182bcd74a Revert "min_element and max_element from std"
This reverts commit ba2d8dc276.
2025-02-28 17:04:37 +01:00
a8b9ec9d67 Revert "std::sort instead of boost::sort"
This reverts commit 2f8566b63e.
2025-02-28 17:04:06 +01:00
ba2d8dc276 min_element and max_element from std 2025-02-28 16:56:20 +01:00
2f8566b63e std::sort instead of boost::sort 2025-02-28 16:47:35 +01:00
75a95d8513 boost::lock_guard replace 2025-02-28 15:28:38 +01:00
7dfb499edf replace boost locks with std 2025-02-28 15:25:58 +01:00
645b95ba02 Renamed LibClasses * VLC to GameLibrary * LIBRARY 2025-02-21 16:54:56 +00:00
2362c6da21 Fixes for multiple new issues from Sonar 2025-02-21 15:57:39 +00:00
ec970c7b22 Support for configuring minimal cost for moving between tiles
- Added `movementCostBase` parameter to game config that defines minimal
amount of movement points that will be spent when moving from one tile
on another while offroad (and cost of Fly / Town Portal spells)
- Added `BASE_TILE_MOVEMENT_COST` bonus type that allows modifying
`movementCostBase` on per-hero basis

Example usage for hota-like pathfinding skill
```json
"tileCostReduction" : {
	"type" : "BASE_TILE_MOVEMENT_COST",
	"val" : -15
}
```
2025-02-03 22:52:33 +00:00
df99645eca Merge pull request #5301 from IvanSavenko/map_loading_fix
Map loading fixes
2025-01-25 17:23:54 +02:00
09db3e4bef Reworked resource piles loading to fix wog maps with mithril 2025-01-25 11:40:21 +00:00
32391dc7a9 Pathfinder cache is now stored separately per playerBlocked
- human player will now use pathfinder settings from config (as before)
- nullkiller AI will now use its own, modified settings
- added option to configure NKAI usage of monolith to config
- fixed pathfinder costs not updating on receiving levelup
2025-01-23 15:28:44 +00:00
65fc50d33b Simplified building ID logic
- Replaced overcomplicated and broken math on dwelling ID's with fixed
enum
- Fixed broken 2nd upgrades and 8th dwelling
- Removed no longer used enumeration values from building ID's
2024-12-25 19:16:21 +00:00
f893c80192 Move UpgradeInfo class to header and source files 2024-12-19 14:13:09 +01:00
af9445c16f Fixes following review 2024-12-17 22:34:06 +01:00
d8d3948ac3 Fix AI to use hillFort all available upgrades. UpgradeInfo refactor. 2024-12-17 22:34:06 +01:00
be2327d000 Removed no longer used or redundant constants 2024-11-28 12:11:13 +00:00
56ee307b3a Extend AI garrison troop removal logic to all RoE campaigns to emulate
H3 logic
2024-11-17 17:38:54 +00:00
d3af9f1c67 Removed pointer to VLC entity from CStackBasicDescriptor 2024-10-30 16:47:02 +00:00
c98ac01e7a Replaced public artType member of ArtifactInstance with getter 2024-10-30 16:47:01 +00:00
08fbcd5239 TerrainTile now uses identifiers instead of pointers to VLC 2024-10-30 16:22:11 +00:00
10ad0fc760 Split CHeroHandler.cpp/.h into 1 file per class
All parts of CHeroHandler.cpp are now in lib/entities/hero
Adjusted includes to use new paths
No functionality changes
2024-10-13 14:01:09 +00:00
3dd4fa2528 Reduce usage of pointers to VLC entities
Final goal (of multiple PR's) is to remove all remaining pointers from
serializeable game state, and replace them with either identifiers or
with shared/unique pointers.

CGTownInstance::town and CGHeroInstance::type members have been removed.
Now this data is computed dynamically using subID member.

VLC entity of a town can now be accessed via following methods:
- getFactionID() returns ID of a faction
- getFaction() returns pointer to a faction
- getTown() returns pointer to a town

VLC entity of a hero can now be accessed via following methods:
- getHeroTypeID() returns ID of a hero
- getHeroClassID() returns ID of a hero class
- getHeroType() returns pointer to a hero
- getHeroClass() returns pointer to a hero class
2024-10-10 12:28:08 +00:00
a8f8c3f4b1 Replaced most of accesses to CGObjectInstance::pos with anchorPoint() 2024-10-09 15:43:46 +00:00
2fe54504ab Merge remote-tracking branch 'origin/develop' into custom_objects_per_zone
# Conflicts:
#	lib/rmg/CRmgTemplate.cpp
2024-09-14 10:19:22 +02:00
9591ce1ab4 Move CompoundMapObjectID to separate file 2024-09-14 08:55:28 +02:00
29f393e024 Removed hardcoded checks for map objects in favor of analyzing
rewardable object content
2024-09-12 12:11:18 +00:00
503b87561e Converted all h3 banks to rewardable, remove most of hardcoded checks 2024-09-12 12:11:18 +00:00
785036836c Rewardable objects may now define guards. Converted Crypt to rewardable. 2024-09-12 12:10:40 +00:00
8225eb454e Added GameSettings to gamestate, potentially allowing to define game
settings per map (or in random map template)
2024-09-05 15:16:27 +00:00
01396b62b7 Extracted handling of type ID's from serializer into a separate class 2024-08-26 19:48:46 +00:00
b84af1a6de Significantly simplify packs applying
Apparently our logic for packs applying with types registration is
overcomplicated and by now completely unnecessary - it became redundant
after introduction of visitor pattern.
2024-08-26 19:48:46 +00:00
2e3e6b1553 market->getObjInstanceID() 2024-08-21 01:01:23 +03:00
58bb2b58e3 IMarket suggestions
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
2024-08-20 18:49:48 +03:00
fd45b5144d IMarket serializeable 2024-08-20 18:49:47 +03:00
49c5f650f7 Merge pull request #4437 from IvanSavenko/battle_sides
Unified handling of battle sides ID's
2024-08-14 18:37:05 +03:00
2a05fbdd50 Unified handling of battle sides ID's
- Replaced BattleSide namespace-enum with enum class
- Merged two different BattleSide enum's into one
- Merged BattlePerspective enum into BattleSide enum
- Changed all places that use integers to represent battle side to use
BattleSide enum
- Added BattleSideArray convenience wrapper for std::array that is
always 2-elements in size and allows access to its elements using
BattleSide enum
2024-08-11 20:54:44 +00:00
3afddbbf29 replaced constant 2024-08-05 23:03:19 +02:00
1a06a2cc44 basic 8th creature support 2024-08-05 21:15:47 +02:00
4aa73b40c9 Split CTownHandler into smaller chunks 2024-07-21 18:21:48 +00:00
6b8f94e6e7 Merge remote-tracking branch 'vcmi/master' into develop 2024-07-11 17:43:44 +00:00
40f17d654d Use containers with pre-allocations to improve pathfinding speed 2024-07-03 18:06:56 +00:00
02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02:00
3bea383b59 Merge branch 'vcmi/beta' into 'vcmi/develop' 2024-06-21 12:58:36 +00:00
9c05e80315 Fix Admiral's Hat whirlpool immunity. Reduce usage of
convertFromVisitablePos
2024-06-11 14:31:11 +00:00
b8beb4fb13 Fixes for various minor issues detected by Sonar Cloud 2024-06-01 11:48:30 +00:00
df83fa33a1 Merge branch 'vcmi/master' into 'vcmi/develop' 2024-05-31 09:34:21 +00:00
5d6470e527 Merge pull request #4025 from IvanSavenko/shared_ptr_lib
[1.6] Use shared_ptr for library entities
2024-05-30 19:14:06 +03:00
5ecb527252 Merge pull request #3997 from IvanSavenko/serialization_refactor
[1.6] Serialization refactor
2024-05-30 19:13:21 +03:00