Ivan Savenko
2a193effcc
Merge branch 'master' into 'develop'
2024-01-25 16:23:13 +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
8e8d42bfa2
Try to simplify / cleanup code to localize crash
2024-01-20 18:40:03 +02:00
Ivan Savenko
ffd604c114
Removed unnecessary access to IHandler::objects
2024-01-19 13:56:06 +02:00
Ivan Savenko
60ffb81b33
Replaced remaining placeholder code with callbacks
2024-01-19 13:55:22 +02:00
Ivan Savenko
e67e4430ba
Removed most of non-const static fields in lib. Reduced header includes.
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
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
Ivan Savenko
b1bd44de1e
Merge pull request #3298 from vcmi/random_prison_distributor
...
Fixes to hero / prison distribution
2024-01-18 16:03:08 +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
Alexander Wilms
cca08e29da
Remove duplicate semicolons
2024-01-16 19:02:39 +00:00
Ivan Savenko
c7897300c0
Fixed missing translation strings on loading campaign save
...
- campaign header now contains text container and stores campaign texts
- map header now contains text container instead of inheriting it
- moved text container registration logic to a wraper class
- fixed registration of copied text containers (from copied map header)
2024-01-15 13:10:25 +02:00
Tomasz Zieliński
3aa67b3e5f
Merge remote-tracking branch 'origin/beta' into random_prison_distributor
2024-01-13 21:02:08 +01:00
Alexander Wilms
5e9f98b15c
Resolve intentionality issues
2024-01-10 00:23:24 +00:00
Alexander Wilms
f3277b7953
Define each identifier in a dedicated statement
2024-01-10 00:22:23 +00:00
Laserlicht
8b262e49a6
add sort for changedate
2024-01-07 20:17:44 +01:00
Ivan Savenko
480a0f19c0
Fix missing modded spells in magic guilds for h3m maps
2024-01-05 16:47:23 +02:00
Tomasz Zieliński
ebf2055afc
- Unban hero if related Prison is destroyed during map generation
...
- Move prison counter to PrisonHeroPlacer
2023-12-24 09:36:26 +01:00
Tomasz Zieliński
b0f0e9caa8
Merge remote-tracking branch 'origin/beta' into random_prison_distributor
2023-12-24 06:46:18 +01:00
Ivan Savenko
20ede710c2
Merge pull request #3362 from IvanSavenko/terrain_decorations
...
Terrain decorations level
2023-12-22 23:39:32 +02:00
Ivan Savenko
8916ae7bcd
Fix water generation, try to improve decoration level a bit
2023-12-22 18:35:38 +02:00
Ivan Savenko
19e851ddff
Implemented configurable level of decorations for terrains
2023-12-22 17:41:30 +02:00
Ivan Savenko
48a8826aa1
Merge pull request #3308 from vcmi/improve_treasure_placement
...
Improve treasure placement
2023-12-22 16:32:59 +02:00
Ivan Savenko
44a79c1ff4
Merge pull request #3327 from Laserlicht/datetime
...
date time format
2023-12-18 13:21:01 +02:00
Laserlicht
9299eaed36
code review
2023-12-16 21:10:27 +01:00
Laserlicht
56562ad8dc
date time format
2023-12-16 18:57:38 +01:00
Ivan Savenko
9ff00d75dc
Do not crash if Scholar is not a rewardable object
2023-12-16 13:46:29 +02:00
Tomasz Zieliński
b9193ecb73
Do not calculate area for invalid positions
2023-12-13 22:06:47 +01:00
Ivan Savenko
337e090ee9
Avoid crash in case if Witch Hut or Shrine is not a rewardable object
2023-12-13 16:52:44 +02:00
Tomasz Zieliński
8fe6a103cd
- Move Hero / Prison distribution to separate modificator
...
- Protect rolling and banning hero with mutex
2023-12-11 07:37:23 +01:00
Ivan Savenko
cd5d6a8f77
Fix loading of artifact ID for "transport item" victory condition
2023-12-03 19:45:18 +02:00
Ivan Savenko
a7d6068bf6
Do not ignore block-visit objects when computing guardian locations
2023-11-28 19:32:03 +02:00
Ivan Savenko
ee46fc806a
Add workaround to loading old map format
2023-11-27 14:09:08 +02:00
Ivan Savenko
e00d871082
Fix few more warnings on game start
2023-11-27 14:08:49 +02:00
Ivan Savenko
68de34e508
Workaround for starting map with invalid witch huts
2023-11-27 14:08:49 +02:00
Ivan Savenko
560a1231a6
Fix loading of maps with Grail or Diplomat Suit placed on map
2023-11-27 14:08:49 +02:00
Ivan Savenko
e979fb7056
Better fix for allowed heroes in h3m - allow all heroes from mods
2023-11-22 19:11:22 +02:00
Ivan Savenko
83ca09f483
Fix loading of allowed heroes from h3m maps
2023-11-21 17:23:46 +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
f7ef474201
Fix format of custom win/loss conditions for h3 campaigns
2023-11-19 23:59:49 +02:00
Ivan Savenko
c872f8418f
Implemented serialization of MapObjectSubID, refactoring of related code
2023-11-17 21:18:34 +02:00
Ivan Savenko
9f906ff1d2
Remove pointer to CGObjectInstance from map header
2023-11-17 16:39:15 +02:00
Ivan Savenko
f53a53051b
Fixed map startup
2023-11-17 16:19:07 +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
6cb1f6ff11
Remove all remaining implicit conversion in lib
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
34338f4eaa
Remove few more implicit conversions
2023-11-15 15:55:19 +02:00
Ivan Savenko
abad4b01ce
Remove explicit convesion to int in operators
2023-11-15 15:55:19 +02:00