1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00
Commit Graph

338 Commits

Author SHA1 Message Date
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
Ivan Savenko
565d810806 Remove test for no longer existing logic 2024-06-01 12:18:09 +00:00
Ivan Savenko
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
Ivan Savenko
7461df161c lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
Ivan Savenko
eb67e04ccb Remove old and unmaintained codeblocks project 2024-05-17 10:44:57 +00:00
Ivan Savenko
3f6eb13ee0 Delete old and unmaintained msvc project files 2024-05-17 10:44:11 +00:00
Ivan Savenko
8b861fc58f Do not check for guards when teleporting using means other than DD 2024-05-07 20:05:23 +00:00
Dydzio
19453aab41 Add handling for yes/no dialogs that can be safely skipped by player 2024-04-17 01:08:27 +02:00
Ivan Savenko
18ece6dcf6 Remove some usages of server-side translations 2024-04-09 16:13:30 +03:00
Ivan Savenko
9e49587749 Replace bonus string description with metastring that can properly
handle translations
2024-04-09 16:13:30 +03:00
Evgeny Malygin
25125f96da
Fix: licenses, pragma guards, StdInc 2024-03-29 07:48:52 +02:00
SoundSSGood
9f688e6fb7 MoveArtifact, BulkMoveArtifacts PlayerColor player field 2024-03-07 22:28:56 +02:00
Ivan Savenko
29860848a5 Cleanup 2024-02-26 12:55:49 +02:00
Ivan Savenko
922966dcf8 Renamed JsonNode::meta to more logical modScope. Member is now private 2024-02-26 12:55:49 +02:00
Ivan Savenko
54796c7c56 Rename toJson to toString/toCompactString for consistency 2024-02-26 12:55:49 +02:00
Alexander Wilms
06a56a0ec3 Try to fix compilation error:
/home/runner/work/vcmi/vcmi/test/../Global.h:700:36: error: no matching function for call to 'max'
                const Floating relativeEpsilon = std::max(std::abs(left), std::abs(right)) * epsilon;
                                                 ^~~~~~~~
/home/runner/work/vcmi/vcmi/test/JsonComparer.cpp:48:16: note: in instantiation of function template specialization 'vstd::isAlmostEqual<double, int>' requested here
                return vstd::isAlmostEqual(value.Float(), 0);
                             ^
2024-02-18 23:32:12 +01:00
Alexander Wilms
fc1e9f70f9 Fix float comparison 2024-02-18 23:16:11 +01:00
Ivan Savenko
c3957c2c2a Moved json files to new directory, split on per-class basis 2024-02-14 13:08:24 +02:00
Ivan Savenko
f2ecd4cf11 Merge branch 'develop' into 'lobby' 2024-02-11 16:13:13 +02:00
Alexander Wilms
522cb571b3 Remove redundant virtual specifiers
`grep -nr virtual | grep -v googletest | grep override > ../redundant_virtual.txt`

```python
import os

with open("../redundant_virtual.txt") as f:
    for line in f:
        print()
        line: str = line.strip()
        print(line)
        tmp = line.split(":")
        file = tmp[0].strip()
        code = tmp[-1].strip()
        print(file)
        print(code)
        new_code = code.replace("virtual ", "", 1)
        # https://superuser.com/a/802490/578501
        command = f"export FIND='{code}' && export REPLACE='{new_code}' && ruby -p -i -e \"gsub(ENV['FIND'], ENV['REPLACE'])\" {file}"
        os.system(command)
```
2024-02-10 20:46:13 +01:00
Ivan Savenko
eaca128c99 Code cleanup 2024-01-26 19:15:57 +02:00
Ivan Savenko
9af7c63a26 Fix build 2024-01-19 13:56:05 +02:00