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

199 Commits

Author SHA1 Message Date
283adc37d7 Unit stack rebalancing rework
- CStackInstance::count is now private with accessor methods
- CStackInstance::experience renamed to totalExperience and now stores
total stack experience (multiplied by stack size) to reduce rounding
errors
- CStackInstance::totalExperience is now private with accessors methods
- stack experience is now automatically reallocated on stack management
- Removed buggy BulkSmartRebalanceStacks pack, that mostly duplicates
BulkRebalanceStacks
- Renamed BulkSmartSplitStack to BulkSplitAndRebalanceStack to drop
unclear "smart" in name
- Reworked split-and-rebalance logic to correctly reallocate stack
experience
2025-05-01 18:18:30 +03:00
4e8e85e3e4 Fix issues reported by Sonar, review fixes 2025-04-27 14:57:31 +03:00
4d57a8ed36 Prefer to pass CGameState as reference instead of pointer 2025-04-27 14:57:31 +03:00
912c2eae94 Fix regressions 2025-04-27 14:57:31 +03:00
e6a8e5d4bd Correctly restore bonus system on deserialization 2025-04-27 14:57:31 +03:00
93b18ee94b Fix some issues detected by Sonar & code review, fix build 2025-04-27 14:57:31 +03:00
d1d2cf4189 Fix crashes on game start, gamestate now derives from GameCallbackHolder 2025-04-27 14:57:31 +03:00
331debaa3f Removed pointers from PlayerState 2025-04-27 14:57:30 +03:00
6d65641a43 Gamestate is now passed as shared pointer 2025-04-27 14:57:30 +03:00
cd7732456a Remove pointer to objects from TerrainTile 2025-04-27 14:57:30 +03:00
bdae7285ae Objects list is now private member of CMap 2025-04-27 14:57:30 +03:00
745040def3 Access to heroes storage in CMap is now done via public methods 2025-04-27 14:57:30 +03:00
1f502c0548 CMap towns and heroes on map fields are now private 2025-04-27 14:57:30 +03:00
0ada2a5ebd Map objects now use shared_ptr (game) 2025-04-27 14:57:30 +03:00
2ca1748e96 Artifact instances are now owned solely by CMap 2025-04-27 14:57:30 +03:00
417ea6451a Remove ConstTransitivePtr from hero and town instances 2025-04-27 14:57:30 +03:00
62cb5412ff CGameState::map is now a private, unique_ptr with accessors 2025-03-08 14:05:14 +00:00
b6026084ea StartInfo in gamestate now use unique_ptr 2025-03-08 14:04:51 +00:00
a061ed04de Remove usage of ConstTransitivePtr from CTown 2025-03-08 14:04:51 +00:00
4e73f7d90f shared_mutex replace boost 2025-02-28 16:01:11 +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
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
ff2de1661a Enable one-way monoliths for AI 2025-01-20 21:34:10 +00:00
d8d3948ac3 Fix AI to use hillFort all available upgrades. UpgradeInfo refactor. 2024-12-17 22:34:06 +01:00
c82db9d574 Fix crash on rearranging troops on non-owned hero 2024-11-17 17:38:54 +00:00
d3af9f1c67 Removed pointer to VLC entity from CStackBasicDescriptor 2024-10-30 16:47:02 +00:00
08fbcd5239 TerrainTile now uses identifiers instead of pointers to VLC 2024-10-30 16:22:11 +00:00
7a190e4929 fix crash 2024-10-19 15:25:26 +02:00
9ed4dbaeb4 Merge remote-tracking branch 'upstream/develop' into adv_search 2024-10-14 19:52:55 +02:00
129f8e6f34 code review
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
2024-10-14 19:30:03 +02:00
11eaed9fef code review 2024-10-12 23:01:14 +02: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
5aebc83bca Fixes pathfinding via subterranean gates located on right edge of map
In this case, 'pos' is actually outside of map borders, so never visible
to a player
2024-10-02 09:24:53 +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
55fd7bd7aa Thieves guild information level is now a bonus type 2024-08-28 13:50:07 +00:00
d49a61645c All objects that can be owned by player now implement IOwnableObject 2024-08-28 12:51:28 +00:00
a481f07daf PlayerState now stores all objects owned by player 2024-08-28 12:51:27 +00:00
2e3e6b1553 market->getObjInstanceID() 2024-08-21 01:01:23 +03:00
4aa73b40c9 Split CTownHandler into smaller chunks 2024-07-21 18:21:48 +00:00
1aa391fdf8 Split CGeneralTextHandler file into 1 file per class form
All text processing code is now located in lib/texts.
No changes other than code being moved around and adjustment of includes

Moved without changes:
Languages.h           -> texts/Languages.h
MetaString.*          -> texts/MetaString.*
TextOperations.*      -> texts/TextOperations.*

Split into parts:
CGeneralTextHandler.* -> texts/CGeneralTextHandler.*
                      -> texts/CLegacyConfigParser.*
                      -> texts/TextLocalizationContainer.*
                      -> texts/TextIdentifier.h
2024-07-20 12:55:17 +00:00
5178e4842e Moved generation of new rumors to server 2024-07-16 13:13:39 +00:00
31e1d39f92 Fix issues introduced by fixing typos 2024-06-27 08:38:04 +00:00
02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02:00
b4c6906471 Merge branch 'vcmi/beta' into 'vcmi/develop' 2024-06-11 19:22:23 +00:00
9c1ce214fc thievesGuild support 2024-05-30 21:58:35 +02: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
7461df161c lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
84bc6c42db Added 'Serializeable' base class for classes serializeable by pointer 2024-05-16 18:40:59 +00:00