1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-26 08:41:13 +02:00
Commit Graph

1095 Commits

Author SHA1 Message Date
Ivan Savenko
7992144763 Gem class is now Sorceress 2024-01-30 23:34:27 +02:00
Ivan Savenko
3abc26e789 Moved checks for campaign heroes to CGHeroInstance class 2024-01-30 23:33:58 +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
ffd604c114 Removed unnecessary access to IHandler::objects 2024-01-19 13:56:06 +02:00
Ivan Savenko
6e629a6a5f split getBonusLocalFirst into two distinct method:
- const method getFirstBonus that returns single matching bonusToString
- non-const method getLocalBonus that returns bonus from current node
2024-01-19 13:56:06 +02:00
Ivan Savenko
496c13b34a Stabilization 2024-01-19 13:56:06 +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
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
Alexander Wilms
f08c6d1ce9 Fix issues created by type replacement script 2024-01-17 14:33:02 +00: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
c21913f661 Fixed initialization of move points and mana for dismissed heroes 2024-01-15 23:16:48 +02:00
Ivan Savenko
2265890f69 Better detection of invalid mod data to avoid crash and notify modders 2024-01-15 18:19:21 +02:00
Ivan Savenko
cf47fbb729
Merge pull request #3435 from IvanSavenko/bugfixing
[1.4.3] Bugfixing
2024-01-06 13:06:07 +02:00
Ivan Savenko
51b7de4b98 Fix double off-by-one bug with CREATURE_GROWTH bonus 2024-01-05 16:57:44 +02:00
Ivan Savenko
edb2ecd751 Fix possible overflow errors on leveling up beyond int64_t limit
- added separate giveExperience method instead of weird changePrimSkill
- experience is now always used in form of int64_t
- max supported level reduced from 201 to 197 to fit into int64_t
- fixed undefined behavior in experience calculation
2024-01-04 23:57:36 +02:00
Joakim Thorén
01f602ab92 Fixes warning about usage of unused variable 2023-12-27 22:25:29 +01:00
Ivan Savenko
4835a1f695 Fix possible crash on abandoned mine with no valid resources 2023-12-24 22:05:47 +02:00
Ivan Savenko
ec5fcb3e7c Do not ignore 'canRefuse' flag for select mode 'first' and 'random' 2023-12-23 00:35:51 +02:00
Dydzio
39c3db04f3 Add missing antimagic functionality to antimagic garrisons 2023-12-21 18:09:33 +01:00
Ivan Savenko
acc09ee51a
Merge pull request #3266 from Laserlicht/puzzle_cheat
implement missing OH3/HDmod cheats
2023-12-17 22:16:22 +02:00
Ivan Savenko
d187309eed Fixed typo - different type was used to select ID and subID 2023-12-16 13:46:29 +02:00
Ivan Savenko
664da58d4f Use MetaString in place of boost::format to avoid exceptions 2023-12-13 17:23:40 +02:00
Ivan Savenko
9385ae76c2 Fix reading of dimensions of h3 map objects 2023-12-11 21:15:46 +02:00
Ivan Savenko
543ee597b8 Fix localization-related error messages 2023-12-11 18:23:52 +02:00
Ivan Savenko
933598dd91
Merge pull request #3273 from vcmi/fix_passable_hero
Fix passable hero
2023-12-10 22:45:33 +02:00
Ivan Savenko
7187ba2d79 Fix crash on visiting Seer Hut with no reward 2023-12-10 19:48:44 +02:00
Ivan Savenko
999db2ed78 Avoid boost::format that throws exception on invalid format string 2023-12-10 16:37:58 +02:00
Ivan Savenko
2de7a3939a Fix text identifier for generic signs without custom text 2023-12-09 18:09:57 +02:00
Tomasz Zieliński
134f78113e Remove unneccessary code 2023-12-09 15:20:11 +01:00
Tomasz Zieliński
cef25cca03 Fix for starting hero being passable 2023-12-09 14:59:09 +01:00
Laserlicht
a24e78a210 real unlimited movement (like in OH3) 2023-12-09 13:42:09 +01:00
Ivan Savenko
c9de10ea74
Merge pull request #3259 from vcmi/fix_corpse
Fix corpse
2023-12-07 23:55:07 +02:00
Tomasz Zieliński
6cd19b81dd Working fir for Corpse issue:
- Do not place guard next to blockVis object, if possible
- Do not place two blockVis objects next to each other
2023-12-06 20:49:28 +01:00
Ivan Savenko
be9c7f2099
Merge pull request #3239 from IvanSavenko/pathfinder_fixes
Pathfinder fixes
2023-12-02 12:20:44 +02:00
Ivan Savenko
37d81e916e Fix creature appearance on hota maps 2023-11-28 19:31:38 +02:00
Ivan Savenko
9277761da5 Do not allow building boat if there is already boat with hero in it 2023-11-28 15:49:03 +02:00
Ivan Savenko
2c8d0338ba Fix error messages in log on map start 2023-11-27 14:08:49 +02:00
Ivan Savenko
6730ec64d5 Fix loading of preset artifacts and creatures on some custom maps 2023-11-26 00:41:49 +02:00
Ivan Savenko
3f60c1b0b3 Remove excessive logging 2023-11-26 00:41:15 +02:00
Ivan Savenko
364977ef40 More meaningful exception messages 2023-11-22 19:11:40 +02:00
Ivan Savenko
f643fff5eb
Merge pull request #3214 from IvanSavenko/bugfixing2
Bugfixing
2023-11-21 22:51:31 +02:00
Ivan Savenko
d3d5b67b22
Merge pull request #3207 from IvanSavenko/skill_selection_fix
Reworked and fixed selection of secondary skills on levelup
2023-11-21 21:35:06 +02:00
Ivan Savenko
d58ea6f28d Fix keymaster visitation status tracking 2023-11-21 16:38:09 +02:00
Ivan Savenko
71825fcc4e Fix crash on artifact movement 2023-11-20 19:56:55 +02:00
Ivan Savenko
e9ac8c67c1 Reworked and fixed selection of secondary skills:
- Fixed off-by-one error when checking for obligatory skills
- If both wisdom and magic school must be offered in the same slot, magic
school will be correctly offered on next levelup
- Obligatory skill can now be proposed for upgrade
- Obligatory skills are now offered using hero class weight instead of
simple random
- If hero has multiple skills not available to his class game will
select random skill instead of first one
- Moved storage of random seed to server instead of mutable member
2023-11-20 18:46:24 +02:00
Ivan Savenko
c872f8418f Implemented serialization of MapObjectSubID, refactoring of related code 2023-11-17 21:18:34 +02:00