1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

167 Commits

Author SHA1 Message Date
Laserlicht
989a437eef fixes #5346 2025-02-14 22:19:26 +01:00
Ivan Savenko
4e6560c4c9 Fixes for issues detected by valgrind 2025-02-06 19:22:04 +00:00
MichalZr6
ecdd394bb1 Use BattleHex as const ref wherever possible
Minor Fixes
Drop unused function from BattleHexArray
2025-01-21 13:23:17 +01:00
Ivan Savenko
e829d723b2 Replace global bonus tree change counter with per-node counter 2025-01-12 12:23:07 +00:00
Ivan Savenko
48473b18f6 move checks for invincible bonus to UnitState & cache 2025-01-10 21:15:37 +00:00
Ivan Savenko
a44bbf4527
Merge pull request #5044 from MichalZr6/battle_hex_array
New container for BattleHexes. Refactors aiming for quick-battle better performance.
2025-01-10 15:32:05 +02:00
Ivan Savenko
e27ca391b1 Fix counter-attack counting 2025-01-08 16:06:31 +00:00
MichalZr6
dbe82b94f6 Changes following review:
- shared_ptr for destructibleEnemyTurns instead of raw pointer
- drop implicit int conversion for BattleHex class
  and implement toInt() instead
- implement necessary operators in BattleHex
- adjust code to work properly with JSON serializer
2025-01-08 07:24:43 +01:00
MichalZr6
ac8104d56d SonarCloud recomendations.
Code review follow-up:
- Replace std::vector with boost::small_vector
- Rename function merge to insert
2025-01-06 23:28:45 +01:00
MichalZr6
7a8edff419 minor fixes 2025-01-06 23:28:44 +01:00
MichalZr6
8c3a417527 Cleanup 2025-01-06 23:18:20 +01:00
MichalZr6
a99274d72e BattleHexArray - new container for BattleHexes 2025-01-06 23:18:18 +01:00
Ivan Savenko
ef8408fa5a Fix tests
Regression from #5158
2025-01-06 21:18:28 +00:00
Ivan Savenko
73d1675ae3 Code cleanup, fixes to discovered regressions 2025-01-05 15:41:42 +00:00
Ivan Savenko
83b9a8d750 Fixes for regressions 2025-01-04 15:09:50 +00:00
Ivan Savenko
dea1eba20b Rework and optimize turnInfo used by pathfinder 2025-01-04 15:09:50 +00:00
Ivan Savenko
579b64cd39 Fix build 2025-01-04 15:09:50 +00:00
Ivan Savenko
39d2f27589 Remove remaining usages of CCheckProxy class 2025-01-04 15:09:50 +00:00
Ivan Savenko
919588f7ff Added cache for common hero-based bonuses 2025-01-04 15:09:50 +00:00
Ivan Savenko
157d6d30c8 Move rest of commonly-accessed UnitState queries to bonus cache 2025-01-04 15:09:50 +00:00
Ivan Savenko
05397e2aaf Caching of bonuses that are requested with different durations 2025-01-04 15:09:50 +00:00
Ivan Savenko
16cfb51f3e Initial version of new bonus caching system 2025-01-04 15:09:50 +00:00
Laserlicht
5c6ce47371 better fix 2024-12-30 18:08:49 +01:00
Ivan Savenko
5caf12f22f Few more fixes to bonus caching 2024-12-22 13:27:40 +00:00
Ivan Savenko
95a07ee5cb Use bonus system cache whenever possible 2024-12-21 18:47:11 +00:00
Ivan Savenko
42b960417c Reworked bonus caching locking scheme:
- use concurrent map from tbb for faster access to already cached values
- use std::shared_mutex instead of boost::mutex to access bonuses
- accessing to values existing in cache is now done without locking main
mutex
2024-12-21 14:43:09 +00:00
Ivan Savenko
ab45c58e26 Use small_vector for bonus list to reduce allocations 2024-12-21 14:43:08 +00:00
Ivan Savenko
c3c5f73a63 Restore save compatibility with 1.5 2024-11-07 12:08:08 +00:00
Ivan Savenko
e7bea6c3b8
Merge pull request #4852 from IvanSavenko/remove_vlc_entities_serialization
Remove remaining pointers to VLC entities from serializer
2024-11-06 22:01:11 +02:00
Ivan Savenko
0969871835
Merge branch 'develop' into mechanical_bonus 2024-10-31 15:14:51 +02:00
Ivan Savenko
01d787fb5a Removed remaining cases of serialization of VLC entities 2024-10-30 16:48:18 +00:00
Ivan Savenko
d3af9f1c67 Removed pointer to VLC entity from CStackBasicDescriptor 2024-10-30 16:47:02 +00:00
Ivan Savenko
db913d95e0
Merge pull request #4808 from Laserlicht/prism_breath
Bonus: prism breath
2024-10-28 12:29:41 +02:00
Ivan Savenko
ee59bc4e71 Add bonus description generation for map objects 2024-10-25 18:36:02 +00:00
Laserlicht
53b7c5da6f added MECHANICAL bonus 2024-10-24 21:30:51 +02:00
Laserlicht
0991f02282 Bonus: prism breath 2024-10-20 22:02:56 +02:00
Ivan Savenko
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
Ivan Savenko
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
Ivan Savenko
cb96b9959e
Merge pull request #4623 from Laserlicht/invincible_bonus
INVINCIBLE bonus
2024-09-20 11:50:29 +03:00
Laserlicht
5e3630adae adjust texts 2024-09-19 20:57:43 +02:00
Laserlicht
b36c05df1d INVINCIBLE bonus 2024-09-19 03:14:45 +02:00
K
bda1adbdfd miniscule bonus system cleanup
update comments, remove one never used method, make another method private
2024-09-18 16:41:41 +02:00
Ivan Savenko
9a08e2eb0f
Merge pull request #4573 from kdmcser/stack_level_updater_for_commander
make TimesStackLevelUpdater support commander
2024-09-12 14:16:16 +03:00
kdmcser
b84d653a99 make TimesStackLevelUpdater support commander 2024-09-09 19:23:23 +08:00
K
a6c7fda649 avoid one loop in BonusList::totalValue() 2024-09-04 23:10:54 +02:00
Ivan Savenko
82c37573fa Removed save compatibility with 1.4
All save compatibility checks targeting 1.4 saves have now been removed.
Saves from 1.5 can still be loaded in 1.6

Implemeted few TODO's in serialization that were postponed to avoid
breaking save compatibility in MP for 1.5.X releases.

Fixed missed case for loading black market object from 1.5 saves
2024-08-29 18:51:53 +00:00
Ivan Savenko
55fd7bd7aa Thieves guild information level is now a bonus type 2024-08-28 13:50:07 +00:00
Ivan Savenko
8371232d29
Merge pull request #4504 from Laserlicht/hota_bonus
disintegrate bonus
2024-08-28 14:00:11 +03:00
K
462c79e190 remove never used code in CBonusSystemNode
Method CBonusSystemNode::getAllBonuses have 'root' parameter which is never
set to anythig else than nullptr. This patch removes the parameter and all
code that depends on it as preparatory work for further bonus system
optimization.
2024-08-25 14:15:21 +02:00
Laserlicht
9c4d4e89d6 disintegrate 2024-08-24 00:29:36 +02:00