1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-14 10:12:59 +02:00
Commit Graph

59 Commits

Author SHA1 Message Date
Ivan Savenko
3847e3e2b4 Better comments, remove dead code 2024-05-28 13:43:16 +00:00
Ivan Savenko
f7989f6dcb Allow landing on guarded tiles when flying in from guarded tile 2024-05-23 19:01:30 +00:00
Ivan Savenko
ac047d0d6d Fixed handling of original game rules pathfinding 2024-05-23 19:01:30 +00:00
Ivan Savenko
0a3cfea017 Simplify code 2024-05-23 19:01:30 +00:00
Ivan Savenko
d7f5d24b99 If original movement rules are on, it is not possible to attack guards
from visitable object directly
2024-05-23 19:01:30 +00:00
Ivan Savenko
ef29c47408 Added GUARDED state to distinguish from blocked visitable 2024-05-23 19:01:30 +00:00
Andrii Danylchenko
157443c1df #3876 - allow to embark after battle for AI pathfinder 2024-05-05 13:52:57 +03:00
Ivan Savenko
75aae66858 Fix off-by-one error - turnLimit 1 should work after 1st turn, not 2nd 2024-04-26 12:44:42 +03:00
Andrii Danylchenko
017fb204a1 NKAI: remove 5th dimension 2024-03-24 09:32:54 +02:00
Alexander Wilms
2ea78a5883 Fix float comparisons
Replace this "==" with a more tolerant comparison operation.
Floating point numbers should not be tested for equality cpp:S1244
2024-02-14 23:30:29 +01:00
Alexander Wilms
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
Ivan Savenko
ad602573ff
Merge pull request #3600 from dydzio0614/sod-fly
Fix SoD fly mechanics
2024-02-11 12:26:20 +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
Dydzio
fd9810adf4 Working SoD version of fly 2024-02-07 19:27:02 +01:00
Dydzio
365fedc7e8 Merge branch 'develop' into sod-fly 2024-02-03 20:40:32 +01:00
Tomasz Zieliński
dbf53d78ba Fix invalid logic which made AI not attack guards 2024-01-24 06:20:46 +01:00
Andrii Danylchenko
0c1664dbe7 NKAI: various AI fixes after tests in headless 2024-01-20 22:55:30 +02:00
Ivan Savenko
6b760089a4
Merge pull request #3473 from IvanSavenko/const_lib
[1.5] Remove non-const global variables from library
2024-01-20 19:22:46 +02:00
Ivan Savenko
1f7e53a609 Code style fixes 2024-01-19 21:21:23 +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
Dydzio
ad8d57f7a4 Merge branch 'beta' into sod-fly 2024-01-18 20:42:22 +01:00
Dydzio
440b468e27 Some partial success on getting fly to work similarly to SoD 2024-01-18 20:42:08 +01: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
Ivan Savenko
a1a317aef4
Merge pull request #3280 from IvanSavenko/hotfix
[1.4.1] Hotfixes
2023-12-10 22:43:05 +02:00
Andrii Danylchenko
48f0da1fdc #3290 - skip bad teleports (exit in rocks) 2023-12-10 18:38:54 +02:00
Ivan Savenko
2261298d09 Revert U-turns block. Actually possible in H3 and has unintended side
effects
2023-12-09 18:09:38 +02:00
Ivan Savenko
773071fee3 Fix AI movement through wandering monsters 2023-12-03 15:58:44 +02:00
Ivan Savenko
8cbc2c01ad Do not allow moving through most of visitable objects 2023-11-28 12:32:24 +02:00
Ivan Savenko
faead7739a Do not allow U-turns while flying. Works fine, but poor representation in
UI
2023-11-28 12:32:24 +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
0842f5afee Removed remaining usages of std::vector<bool> 2023-11-15 15:55:18 +02:00
Ivan Savenko
20ef3a69e7 Fix most of memleaks discovered by valgrind 2023-11-13 16:27:15 +02:00
Ivan Savenko
04aeea9b68 use toEnum instead of getNum for switch'es 2023-11-03 19:20:25 +02:00
Ivan Savenko
885dce0c27 Replace static_cast's of Identifiers with getNum call 2023-11-03 16:03:29 +02:00
Ivan Savenko
2b9c362d5b Explicitly convert identifier to underlying enumeration 2023-11-03 16:03:29 +02:00
Ivan Savenko
8346d71c98 Remove more subID access 2023-11-01 14:44:05 +02:00
Ivan Savenko
36eacf99d5 Cleanup 2023-10-28 17:58:08 +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
77facf9387 Implement missing functions, fixes linking errors 2023-10-22 16:54:56 +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
dd841bdaa7 Use enum instead of mix of bool's and int's for tile reveal 2023-10-16 00:12:38 +03:00
Andrii Danylchenko
2dd0d76412 NKAI: water and air walking 2023-09-30 10:37:32 +03:00
Ivan Savenko
d257fb37f0 Use optional instead of Json for queries 2023-09-26 13:42:20 +03:00
Ivan Savenko
c8a96647c3 Add turn limit option to pathfinder 2023-09-26 13:42:20 +03:00
Ivan Savenko
c8e6a7cd27 Fixed most common cases of movement actions 2023-09-16 20:07:26 +03:00
Andrii Danylchenko
903be33bf3 #2689 - fix approaching guards when closest tile is double-guarded 2023-09-16 17:47:34 +03:00
Ivan Savenko
41210c1dbf Client-side support for multiple battles 2023-09-06 16:03:47 +03:00
Ivan Savenko
e54287ea5d Converted remaining identifier to new system 2023-08-25 13:38:02 +03:00
Ivan Savenko
62cd8b12d4 Converted several namespace enums to enum class 2023-08-25 13:38:02 +03:00