Ivan Savenko
626087ab14
Merge pull request #3561 from MnHebi/develop
...
Try to improve VCAI building build order
2024-01-31 21:48:36 +02:00
Ivan Savenko
2e4895766a
Implemented tracking of objects destroyed by players
2024-01-31 01:37:33 +02:00
Ivan Savenko
a9866bb5c6
Added RandomGeneratorUtil::nextItemWeighted convenience method
2024-01-31 00:17:40 +02:00
MnHebi
8b24b0e9a7
Add Marketplace, Blacksmith into extra buildings category to ensure they get built. Misc changes.
2024-01-26 00:56:36 +02:00
Laserlicht
7f58333ef9
quick combat vs ai
2024-01-25 23:44:41 +01:00
MnHebi
4318b25399
Merge branch 'vcmi:develop' into develop
2024-01-25 21:27:06 +02:00
Ivan Savenko
2a193effcc
Merge branch 'master' into 'develop'
2024-01-25 16:23:13 +02:00
MnHebi
a668dc2721
Try to improve VCAI building build order. Testing reveals extra structures still get done before intended build order(seen Market being built when Dwellings were expected).
2024-01-25 03:26:42 +02:00
Ivan Savenko
284273379e
Merge pull request #3536 from IvanSavenko/serialization_refactor
...
Refactoring of serialization versioning handling
2024-01-22 19:49:24 +02:00
Andrii Danylchenko
bf54a6a7d3
Merge pull request #3537 from vcmi/nkai-fix-pathfinder-commited-tiles
...
NKAI: avoid writing to commited tiles when calculating hero chain
2024-01-21 14:51:33 +02:00
Andrii Danylchenko
708e0d1107
NKAI: avoid writing to commited tiles when calculating hero chain
2024-01-21 10:18:39 +02:00
Andrii Danylchenko
cb297793e0
NKAI: fix lock
2024-01-21 10:05:40 +02:00
Andrii Danylchenko
0c1664dbe7
NKAI: various AI fixes after tests in headless
2024-01-20 22:55:30 +02:00
Andrii Danylchenko
1db43a509e
NKAI: fix casting FLY several times during path calculation
2024-01-20 22:55:28 +02:00
Andrii Danylchenko
36bc9ddcec
NKAI: mutex for internal AI state
2024-01-20 22:55:27 +02:00
Andrii Danylchenko
cc7fc4a2c6
Fix headless mode
2024-01-20 22:55:27 +02:00
Ivan Savenko
0c07384293
Refactoring of serialization versioning handling
...
- Removed 'version' field from serialize() method
- Handler classes - Binary(De)Serializer now have 'version' field
- Serialization versioning now uses named enum
Save compatibility with 1.4.X saves should be intact
2024-01-20 20:34:51 +02:00
Ivan Savenko
62935b4ba4
Fix crash on using StupidAI for player actions
2024-01-20 17:15:51 +02:00
Ivan Savenko
d04241b10a
Code cleanup
2024-01-19 23:02:00 +02:00
Ivan Savenko
ea1f05d15a
Stabilization
2024-01-19 13:55:22 +02:00
Ivan Savenko
60ffb81b33
Replaced remaining placeholder code with callbacks
2024-01-19 13:55:22 +02:00
Ivan Savenko
a15366f5a5
Make IObjectInterface::cb non-static
2024-01-19 13:55:21 +02:00
Ivan Savenko
2c4cad7d9c
Slight simplification of bonus system node class
2024-01-19 13:54:49 +02:00
Ivan Savenko
d5c4478816
Remove most of non-const access to VLC entities
2024-01-19 13:54:49 +02:00
Ivan Savenko
bd5682ecc3
Merge remote-tracking branch 'vcmi/master' into develop
2024-01-19 13:49:54 +02:00
Alexander Wilms
73019c204d
Replace redundant types with auto
for the lvalues of template factory functions for smart pointers
...
grep -r --include \*.h --include \*.cpp "= std::" * | grep -v auto | grep -Po ".*[^ ]+ [^ ]+ [^ ]*[ ]*=.*;" | grep -v "auto\|int\|char\|bool\|float|\double\|for\|if\|googletest\|fuzzylite\|size_t\|using\|return" | grep -v double | grep -v si64 | grep -v si32 | grep -v ui32 | grep \< | grep -v float | tr -d '\t' | grep -v assert > redundant_types.txt
import re
with open("redundant_types.txt") as f:
for line in f:
line = line.strip()
path = line.split(":", 1)[0]
original_code = ":".join(line.split(":")[1:]).strip()
print()
print(path)
print(original_code)
prefix = "auto "
if original_code.startswith("static"):
static = True
else:
static = False
cpp_type = " ".join(original_code.split("=")[0].strip().split(" ")[0:-1])
print(cpp_type)
if static:
new_code = "static auto "+ " ".join(original_code.split(" ")[2:])
else:
new_code = "auto "+ " ".join(original_code.split(" ")[1:])
print(new_code)
if True:
with open(path, "r") as f:
filedata = f.read()
filedata = filedata.replace(original_code, new_code)
with open(path, "w") as f:
f.write(filedata)
2024-01-17 12:50:00 +00:00
Ivan Savenko
e849e4170a
Merge pull request #3486 from Alexander-Wilms/replace-redundant-types-with-auto
...
Replace redundant types with `auto`
2024-01-17 13:31:05 +02:00
Alexander Wilms
1b85abb508
Use auto instead of redundant type in initializations using new
...
grep -r --include \*.h --include \*.cpp "=" * | grep -v "auto\|int\|char\|bool\|float|\double\|for\|if\|googletest\|fuzzylite\|size_t\|using\|return\|{\|}\|= \"\|= tr(\|virtual\|void" | grep -Po ".*[^ ]+ [^ ]+ [^ ]*[ ]*=.*;" | grep -v "float\|nullptr" | grep "new" | grep -v "AI/FuzzyLite" | grep \( | grep "= new" > redundant_types.txt
import re
with open("redundant_types.txt") as f:
for line in f:
line = line.strip()
path = line.split(":", 1)[0]
original_code = line.split(":")[1].strip()
if "new " in original_code:
cpp_type = original_code.split(" ")[0]
if original_code.count(cpp_type) == 2:
print()
print(path)
print(original_code)
new_code = "auto "+" ".join(original_code.split(" ")[1:])
print(new_code)
with open(path, "r") as f:
filedata = f.read()
filedata = filedata.replace(original_code, new_code)
with open(path, "w") as f:
f.write(filedata)
2024-01-16 21:40:53 +00:00
Alexander Wilms
cca08e29da
Remove duplicate semicolons
2024-01-16 19:02:39 +00:00
Ivan Savenko
a582cb554e
Merge pull request #3500 from IvanSavenko/fix_dendroid_bind
...
[1.4.3] Fix handling of Dendroid's Bind ability
2024-01-15 12:02:06 +02:00
Ivan Savenko
b4a1a755a4
Merge pull request #3498 from IvanSavenko/simturns_pathfinder
...
[1.4.3] Fixes for simultaneous turns
2024-01-15 12:00:54 +02:00
Ivan Savenko
0d0d3d8c80
Renamed speed -> getMovementRange, remove misleading default parameter
2024-01-14 17:14:36 +02:00
Alexander Wilms
bc781c28e0
Remove trailing semicolon from NET_EVENT_HANDLER macro
2024-01-14 14:49:25 +00:00
Andrii Danylchenko
3602be5eab
BattleAI: remove adjustPositions method as it gives more troubles than usefulness
2024-01-14 10:23:44 +02:00
Ivan Savenko
8303ce5d13
Added option to ignore guards in pathfinder
...
Used for simturns contact detection, by default disabled for player
pathfinding
2024-01-13 19:44:37 +02:00
Alexander Wilms
f3277b7953
Define each identifier in a dedicated statement
2024-01-10 00:22:23 +00:00
Andrii Danylchenko
1a1ae5cd8b
BattleAI: fixes
2024-01-02 17:35:10 +02:00
Joakim Thorén
daf9f9f7f5
Re-add const that was erronously removed with 88ec4fa
...
Co-authored-by: Andrey Filipenkov <kambaladecapitator@gmail.com>
2023-12-30 11:01:21 +01:00
Joakim Thorén
88ec4fa0e7
Use getTileThreat-helper instead of directly accessing hitMap with tile coordinates
2023-12-29 23:12:06 +01:00
Joakim Thorén
61314a36f6
Fix copy-paste mistake
2023-12-27 22:35:43 +01:00
Joakim Thorén
406d136cdc
Fixes warnings about possibly dangling references
2023-12-27 22:24:58 +01:00
Ivan Savenko
85de3143ff
Fixed Genie spellcasting logic to account for spell immunities
2023-12-24 01:13:19 +02:00
Dydzio
fe39faf36c
Add UNTIL_OWN_ATTACK bonus duration and use for berserk
2023-12-19 19:52:40 +01:00
Andrii Danylchenko
26b6d1cf74
NKAI: fix capturing shipyards
2023-12-02 14:03:54 +02:00
Ivan Savenko
d326c53b9a
AI will now respect current value of "Use spells in autocombat" setting
2023-11-28 15:48:35 +02:00
Ivan Savenko
60ca6f968c
Fix hero limit check in AI
2023-11-27 14:08:49 +02:00
Ivan Savenko
ff6260e5c5
Merge pull request #3195 from IvanSavenko/identifier_string_serialization
...
Serialize Identifiers that can be added by mods as strings
2023-11-20 14:07:24 +02:00
Ivan Savenko
b58301849b
Pass functor via reference to avoid costly copies
2023-11-18 19:43:11 +02:00
Ivan Savenko
9b8145f522
Compute creature speed only once during evaluation
2023-11-18 19:41:29 +02:00
Ivan Savenko
9f906ff1d2
Remove pointer to CGObjectInstance from map header
2023-11-17 16:39:15 +02:00
Ivan Savenko
76956cfe3a
Merge pull request #3188 from IvanSavenko/remove_identifier_implicit_int_conversion2
...
Remove implicit conversion of identifier to integer
2023-11-16 17:26:32 +02:00
Ivan Savenko
52050d0ef1
Fix build
2023-11-15 15:55:19 +02:00
Ivan Savenko
96c81be68e
Win/loss conditions now use VariantIdentifier. Removed non-implemented
...
options
2023-11-15 15:55:19 +02:00
Ivan Savenko
20ef3a69e7
Fix most of memleaks discovered by valgrind
2023-11-13 16:27:15 +02:00
Ivan Savenko
4a7fa9bf8c
Simplified CTypeList class
2023-11-08 22:05:36 +02:00
Ivan Savenko
6b81012f31
Use variant identifier in netpacks where applicable
2023-11-08 14:00:23 +02:00
Ivan Savenko
10e50548e7
Converted Component class to use VariantIdentifier instead of int
2023-11-02 12:00:04 +02:00
Ivan Savenko
8346d71c98
Remove more subID access
2023-11-01 14:44:05 +02:00
Ivan Savenko
7107b3202f
Merge pull request #3069 from SoundSSGood/artifact-location-id
...
ArtifactLocation now use ID for artHolder identification
2023-11-01 14:41:36 +02:00
SoundSSGood
ab2f6abb87
ArtifactLocation now use ID for artHolder identification part2
2023-10-29 17:46:13 +02:00
SoundSSGood
61fc236d79
ArtifactLocation now use ID for artHolder identification part1
2023-10-29 17:46:13 +02:00
Alexander Wilms
5cbc75d3b7
Merge remote-tracking branch 'upstream/develop' into develop
2023-10-29 13:35:37 +00:00
Alexander Wilms
ed86a917eb
AI/BattleAI/BattleAI.cpp: Use Class template argument deduction for wallParts array
...
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
2023-10-29 13:34:19 +00:00
Alexander Wilms
0232ae5327
AI/BattleAI/BattleEvaluator.cpp: Convert this integer literal to a bool literal.
...
Integer literals should not be cast to bool
2023-10-29 13:34:19 +00:00
Alexander Wilms
bfddc90ff4
AI/BattleAI.cpp: Use "std::array" or "std::vector" instead of a C-style array.
...
Variables of array type should not be declared cpp:M23_356
2023-10-29 13:34:19 +00:00
Ivan Savenko
0169c65937
Merge pull request #3100 from IvanSavenko/split_net_packs
...
Split netpacks.h into multiple files
2023-10-29 13:46:40 +02:00
Alexander Wilms
0a6c82c639
AI/Nullkiller/Behaviors/DefenceBehavior.{h,cpp}: treat -> threat
2023-10-27 23:34:11 +00:00
Alexander Wilms
457e73ed12
AI/BattleAI/BattleExchangeVariant.cpp: Do not assign data members in a constructor. Initialize members in an initialization list.
...
Member data should be initialized in-class or in a constructor initialization list
2023-10-27 23:34:11 +00:00
Alexander Wilms
b10b1a5444
AI/BattleAI/BattleExchangeVariant.cpp: This function should be declared "const".
...
Member functions that don't mutate their objects should be declared "const"
2023-10-27 23:34:11 +00:00
Alexander Wilms
af330ff038
AI/BattleAI/BattleEvaluator.cpp: Remove this redundant cast.
...
Redundant casts should not be used
2023-10-27 18:19:17 +00:00
Alexander Wilms
f01ec55d21
Use the "nullptr" literal.
...
"nullptr" should be used to denote the null pointer
2023-10-27 18:18:59 +00:00
Alexander Wilms
bcaa2e5966
AI/VCAI/VCAI.cpp: Remove "e" from "throw" statement to rethrow the original exception.
...
The original exception object should be rethrown
2023-10-27 14:29:44 +00:00
Ivan Savenko
5cbf5031ea
move SetStackEffect to a separate file
2023-10-24 01:27:52 +03:00
Ivan Savenko
b88a8da4e8
Split off some netpack structures into separate files
2023-10-23 13:59:15 +03:00
Andrii Danylchenko
f74daa2e1f
BattleAI: fix health bounty calculation
2023-10-22 22:06:42 +03:00
Andrii Danylchenko
870fbd50e3
BattleAI: bigger reachability map
2023-10-22 21:37:55 +03:00
Andrii Danylchenko
9eb9404f28
BattleAI: divide only positive part of score onto turns count
2023-10-22 21:37:54 +03:00
Ivan Savenko
3880ea58b9
Merge branch 'josch/dos2unix' into develop
2023-10-22 18:39:03 +03:00
Ivan Savenko
4f47555977
Split OBJECT bonus source into OBJECT_TYPE and OBJECT_INSTANCE
2023-10-22 16:55:19 +03:00
Ivan Savenko
ac925bb786
Renamed new types for consistency with code style
2023-10-22 16:55:19 +03:00
Ivan Savenko
80e6485965
MetaIdentifier now uses std::variant internally
2023-10-22 16:55:19 +03:00
Ivan Savenko
b394158dc9
Bonus Source ID now uses metaidentifier
2023-10-22 16:55:18 +03:00
Ivan Savenko
77facf9387
Implement missing functions, fixes linking errors
2023-10-22 16:54:56 +03:00
Ivan Savenko
910ad50417
Fix client & server compilation
2023-10-22 16:54:48 +03:00
Ivan Savenko
0a10fc30b8
(lib) Bonus subtype is now stored as metaidentifier that can store any
...
other identifier inside it
2023-10-22 16:54:43 +03:00
Ivan Savenko
454ba44ac5
Merge pull request #2988 from IvanSavenko/configurable_extensions
...
Extension of configurable object functionality
2023-10-22 16:24:47 +03:00
Johannes Schauer Marin Rodrigues
a1a5bc28c2
convert line endings from CRLF (Windows) to LF (Linux/Unix)
...
Mixed line endings cause problems when exporting patches with
git-format-patch and then trying to "git am" a patch with mixed and
non-matching line endings. In such a situation git will fail to apply
the patch.
This commit runs the dos2unix tools on the remaining files with CRLF
(\r\n) line endings to convert them to line-feeds (\n) only.
Files that are Windows specific like *.vcxproj and *.props files were
not converted.
Closes : #3073
2023-10-19 16:23:21 +02:00
Johannes Schauer Marin Rodrigues
f9e1b302c7
some spelling fixes
2023-10-18 01:41:02 +02:00
Ivan Savenko
fd01a25352
Implemented basic version of configurable Witch Hut
2023-10-16 00:12:38 +03:00
nordsoft
fadf086e61
Fix review comments
2023-10-12 13:30:01 +02:00
nordsoft
7ccd4cdcb2
Refactor quests progress
2023-10-11 21:10:42 +02:00
nordsoft
5b10b457cf
Fix code review suggestions
2023-10-11 00:47:19 +02:00
nordsoft
5eeda3cd25
Quests mostly work
2023-10-10 23:44:29 +02:00
nordsoft
bb238f9b72
New quests work
2023-10-10 23:44:29 +02:00
nordsoft
1460541ee5
New limiter based quests
2023-10-10 23:44:29 +02:00
Ivan Savenko
46e4d862a5
Fix AI recruitment
2023-10-04 17:47:12 +03:00
Ivan Savenko
39a92cdde3
Add query for dwellings dialog
2023-10-04 17:47:12 +03:00
Ivan Savenko
898733eed7
Added Query to track visit duration for Taverns and Markets
2023-10-04 17:47:12 +03:00
Andrii Danylchenko
ebe155fa95
NKAI: mana recovery
2023-09-30 10:37:36 +03:00
Andrii Danylchenko
2dd0d76412
NKAI: water and air walking
2023-09-30 10:37:32 +03:00