1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-09 01:06:07 +02:00
Commit Graph

136 Commits

Author SHA1 Message Date
645b95ba02 Renamed LibClasses * VLC to GameLibrary * LIBRARY 2025-02-21 16:54:56 +00:00
2362c6da21 Fixes for multiple new issues from Sonar 2025-02-21 15:57:39 +00:00
6c4996ff54 AI will now devalue the usefulness of non-flying units when attacking defensive structures in order to prevent suiciding against castles 2025-02-09 17:33:39 +00:00
5ec5e23534 Add caching for commonly accessed values 2025-01-12 12:21:10 +00:00
14320fb100 Fix spawned wandering monsters not correctly attached to bonus system 2025-01-12 11:06:45 +00:00
e189d6a737 map editor: fix crash when copying monster 2024-12-31 14:46:23 +01:00
e60a565942 Merge remote-tracking branch 'upstream/develop' into develop 2024-11-07 15:24:19 +01:00
a70f5de8c6 Merge remote-tracking branch 'upstream/develop' into develop 2024-11-07 14:35:13 +01:00
b9ff192a91 Fix regressions from previous PR 2024-11-07 12:07:45 +00:00
d3af9f1c67 Removed pointer to VLC entity from CStackBasicDescriptor 2024-10-30 16:47:02 +00:00
61fba1fedd Merge remote-tracking branch 'upstream/develop' into develop 2024-10-10 17:23:39 +02:00
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
3d9892f6b3 Merge remote-tracking branch 'upstream/develop' into develop 2024-10-01 16:08:57 +02:00
586a32a616 CArtifactSet cleanup 2024-09-23 23:39:19 +03:00
044dc272c2 Update lib/CCreatureSet.h
Use a better name and add a comment to explain what it does.

Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
2024-09-05 16:31:44 +02:00
aa891cb8b1 Armycost
Added new method to retrieve the cost of an army to be used for AI-decision-making.
2024-07-07 22:38:37 +02:00
02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02:00
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
7461df161c lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
84bc6c42db Added 'Serializeable' base class for classes serializeable by pointer 2024-05-16 18:40:59 +00:00
678cacbd25 Remove more redundant virtual specifiers
`grep -nr "virtual " | grep -v googletest | grep " override" | grep -v overriden > ../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(":",2)
        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-13 15:21:30 +01:00
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
6b81012f31 Use variant identifier in netpacks where applicable 2023-11-08 14:00:23 +02:00
10e50548e7 Converted Component class to use VariantIdentifier instead of int 2023-11-02 12:00:04 +02:00
3c5527a222 ArtifactLocation now use ID for artHolder identification part3 2023-10-29 17:46:13 +02:00
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
5b10b457cf Fix code review suggestions 2023-10-11 00:47:19 +02:00
97097c20ad Merge pull request #2874 from SoundSSGood/exchange-window-update
Exchange window update
2023-09-27 15:50:52 +03:00
a83f290e13 bulk move artifacts only equipped, only backpack 2023-09-19 13:31:42 +03:00
2960895041 Issues fixed 2023-09-17 22:19:45 +02:00
f8541d0ae4 Merge branch 'vcmi/master' into 'vcmi/develop' 2023-09-15 13:59:02 +03:00
56c969be4f Fix commanders requirements for special skills to match WoG 2023-09-13 23:08:22 +02:00
823ffa7a07 Always use ResourcePath for referencing images and animations 2023-09-04 18:22:34 +03:00
e2718db791 Converted several enumerations into constants 2023-08-25 13:38:02 +03:00
e57f8742cd Rename ambiguos 'clear' to 'clearSlots'
A lot of map objects inherit from CCreatureSet and as result - get
clean() method that resets object army
2023-08-07 19:13:02 +03:00
d44821e733 CArtifactInstance moved to own file 2023-06-30 19:41:19 +03:00
1366825f08 final fixup 2023-05-24 16:10:06 +03:00
a6de9097be vcmi: rename HeroBonus.h to Bonus.h 2023-05-02 11:20:58 +03:00
b6eb2dc060 vcmi: rename IFactionMember and ICreature 2023-05-02 00:54:53 +03:00
1d34c73c2d vcmi: split CBonusSystemNode, BonusParams and prop
More splitting of HeroBonus.h
2023-05-02 00:54:53 +03:00
6fa1b2b19f vcmi: move bonuses to its own folder 2023-05-02 00:53:50 +03:00
af25ad0866 vcmi: split creatures and faction members 2023-05-02 00:53:50 +03:00
f4f0fd5945 vcmi: magicResistance is IFactionMember property
It is no reason to keep it inside IBonusBearer
2023-05-02 00:53:50 +03:00
4f7035d3ff vcmi: add IFactionMember abstract class 2023-05-02 00:53:50 +03:00
86f5d6de69 vcmi: modernize headers 2023-04-30 13:35:54 +03:00
7a5775a9f9 vcmi: use std::optional 2023-04-17 00:43:13 +03:00
5b658462a1 Renamed army formation enum value 2023-04-15 17:20:38 +03:00
3738171b21 Refactoring of H3M loader to make HotA format support easier
- extracted low-level reader from MapFormatH3M class
- added separate structure to define version-specific values
- cleared up some H3M format edge cases
- replaced witch hut skill vector with set
- converted several fields to enum type
2023-04-15 17:20:38 +03:00
4da97682be vcmi: remove code duplication for native terrain 2023-04-10 19:28:17 +03:00
7326980bd4 vcmi: rename WithXXX to IXXXProvider 2023-04-10 19:28:16 +03:00