1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-14 10:12:59 +02:00
Commit Graph

359 Commits

Author SHA1 Message Date
Ivan Savenko
604e3b5c67
Merge pull request #4763 from IvanSavenko/herohandler_split
Split CHeroHandler.cpp/.h into 1 file per class
2024-10-14 19:05:48 +03:00
Ivan Savenko
cee3521f57
Merge pull request #4770 from IvanSavenko/prison_fix
Fix for loading hero types / identities
2024-10-14 18:16:53 +03: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
31095248ab Removed typeName and subtypeName properties from CGObjectInstance 2024-10-13 13:05:50 +00:00
Ivan Savenko
a8e84c55f6 Fix some of the new warnings from sonarcloud 2024-10-11 10:45:29 +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
d0606d2dc9 Fix scripting build 2024-10-07 15:14:03 +00:00
Ivan Savenko
c0f5c7c0ea Replace pointer with reference in pack apply functions 2024-10-07 14:59:46 +00:00
Ivan Savenko
786f80871e Replace more usages of pointers to packs with references 2024-10-07 14:59:14 +00:00
Laserlicht
a826b88641
Merge branch 'develop' into spell 2024-10-07 12:55:23 +02:00
Ivan Savenko
f816c3306b
Merge pull request #4694 from Laserlicht/spell_cast_only_self
cast only on self
2024-10-01 17:20:20 +03:00
Laserlicht
e6cb87abac cast only on self 2024-09-28 17:32:53 +02:00
Laserlicht
d929bfb9d1 rename; introduce factor 2024-09-28 15:05:13 +02:00
Laserlicht
afb90c076d better UI 2024-09-28 02:34:18 +02:00
SoundSSGood
b9ae7f1138 CMap put move and remove artifact method 2024-09-23 23:30:38 +03:00
Laserlicht
0aaafc4c8a cast without skip 2024-09-14 15:10:24 +02:00
Ivan Savenko
39a2c29c97 Removed creatureBank flag from battle, battles now receive BattleLayout
struct that defines how units are placed in combat
2024-09-12 12:11:18 +00:00
Ivan Savenko
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
Ivan Savenko
6179521364
Merge pull request #4556 from IvanSavenko/town_building_visit
Implemented explicitly visitable town buildings, e.g. hota mana vortex
2024-09-05 17:21:21 +03:00
SoundSSGood
7466d7452d vcmiscrolls 2024-09-05 15:51:45 +03:00
Ivan Savenko
b09d9d501b Pass pointer to actual caller in showBlockingDialog callWith
Fixes activation of all rewardable buildings in town on blocking dialog
answer
2024-09-04 15:14:56 +00:00
Ivan Savenko
ce1e0b8875 Moved NewTurn pack generation to NewTurnProcessor 2024-08-28 13:03:24 +00:00
Ivan Savenko
11e8b04ac5
Merge pull request #4463 from SoundSSGood/IMarket-refactoring
IMarket refactoring
2024-08-26 22:48:23 +03:00
Ivan Savenko
897bc65e64
Merge pull request #4508 from kaja47/dead-code-must-die
remove never used code in CBonusSystemNode
2024-08-26 19:11:03 +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
Andrii Danylchenko
ff8a745a50 BattleAI: optional simulation depth 2024-08-21 23:27:42 +03:00
SoundSSGood
2e3e6b1553 market->getObjInstanceID() 2024-08-21 01:01:23 +03:00
Ivan Savenko
01a9509ccb Remove unused code, reduce includes 2024-08-19 11:47:13 +00:00
Ivan Savenko
49c5f650f7
Merge pull request #4437 from IvanSavenko/battle_sides
Unified handling of battle sides ID's
2024-08-14 18:37:05 +03:00
Ivan Savenko
170330109f
Merge pull request #4415 from godric3/map-editor-validate-spells
map editor: check hero and town spells during mod assessment
2024-08-12 17:20:01 +03:00
Ivan Savenko
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
godric3
07a1e9b768 fix tests 2024-08-10 22:39:35 +02:00
Andrii Danylchenko
8e79263b21
Merge pull request #4323 from vcmi/battle-ai-fixes
Battle ai fixes
2024-08-10 10:48:35 +03:00
Andrii Danylchenko
3d856bfa9d Merge remote-tracking branch 'origin/develop' into battle-ai-fixes 2024-08-03 12:54:25 +03:00
Alexander Wilms
6678aafbbb Update googletest submodule
Fixes the following warning, occurring during the linux-clang-test CI builds:

[824/832] Building CXX object test/googletest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
In file included from /home/runner/work/vcmi/vcmi/test/googletest/googletest/src/gtest-all.cc:38:
In file included from /home/runner/work/vcmi/vcmi/test/googletest/googletest/include/gtest/gtest.h:65:
In file included from /home/runner/work/vcmi/vcmi/test/googletest/googletest/include/gtest/gtest-death-test.h:43:
In file included from /home/runner/work/vcmi/vcmi/test/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h:47:
In file included from /home/runner/work/vcmi/vcmi/test/googletest/googletest/include/gtest/gtest-matchers.h:48:
/home/runner/work/vcmi/vcmi/test/googletest/googletest/include/gtest/gtest-printers.h:532:9: warning: implicit conversion from 'int32_t' (aka 'int') to 'float' may lose precision [-Wimplicit-int-float-conversion]
  532 |     if (static_cast<int32_t>(val * mulfor6 + 0.5) / mulfor6 == val) return 6;
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~
/home/runner/work/vcmi/vcmi/test/googletest/googletest/include/gtest/gtest-printers.h:551:17: note: in instantiation of function template specialization 'testing::internal::AppropriateResolution<float>' requested here
  551 |   os->precision(AppropriateResolution(f));
      |                 ^
/home/runner/work/vcmi/vcmi/test/googletest/googletest/include/gtest/gtest-printers.h:544:9: warning: implicit conversion from 'int32_t' (aka 'int') to 'float' may lose precision [-Wimplicit-int-float-conversion]
  544 |     if (static_cast<int32_t>(val / divfor6 + 0.5) * divfor6 == val) return 6;
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~
2 warnings generated.
2024-08-02 15:09:48 +00:00
Laserlicht
3e5df61946 code review 2024-07-29 22:54:42 +02:00
Andrii Danylchenko
9edb0afff8 BattleAI: fix dragonbreath retaliation 2024-07-28 14:41:32 +03:00
Laserlicht
6273e678a4
fix 2024-07-25 10:30:57 +02:00
Ivan Savenko
4aa73b40c9 Split CTownHandler into smaller chunks 2024-07-21 18:21:48 +00:00
Ivan Savenko
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
Ivan Savenko
2d3734656d Fix test 2024-07-19 12:17:06 +00:00
Ivan Savenko
2020d96070
Merge pull request #4071 from IvanSavenko/fix_rng_syncronization
[1.6] Fix potential desync if client uses different stdlib with different random number generators
2024-07-19 13:08:09 +03:00
Alexander Wilms
5712c3f9f4 JsonNode change: Fix test 2024-07-17 15:20:18 +02:00
Ivan Savenko
c91f8cd511 Fix tests 2024-07-16 13:13:39 +00:00
Ivan Savenko
55bf75c43e Remove no longer used random seeds from StartInfo 2024-07-16 13:13:39 +00:00
Ivan Savenko
0d66ddbeec GameState now uses random generator from server. Blocked access to rmg
on client
2024-07-16 13:13:38 +00:00
Ivan Savenko
63bcf7d83c Replaced most of usages of CRandomGenerator with vstd::RNG in library 2024-07-16 13:13:07 +00:00
Ivan Savenko
60a51e98de Remove usage of std::function from CRandomGenerator 2024-07-16 13:13:07 +00:00
Alexander Wilms
02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02:00
MichalZr6
2f0bea9075 Update mock_battle_Unit.h 2024-06-12 13:37:43 +02:00