1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00
Commit Graph

53 Commits

Author SHA1 Message Date
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
Ivan Savenko
85262cf4f5 Moved CGameState files into a separate directory 2023-06-26 17:15:59 +03:00
Ivan Savenko
e0ea994656 Moved some pathfinding options to game settings 2023-06-25 17:42:36 +03:00
Ivan Savenko
03c3797945 Fixed pathfinding with free ship boarding (Admiral's Hat) 2023-06-25 17:42:36 +03:00
Ivan Savenko
08cfbe79cf Added encapsulation for movement points access 2023-06-25 17:42:36 +03:00
Ivan Savenko
f66a8a9cf0 Do not allow stopping movement while in air
(client-side check, since proper fix would require major rewrite)
2023-06-25 17:42:36 +03:00
Ivan Savenko
f7b27da00e Implemented support for "coast visitable" objects:
- objects marked as coast visitable can be visited from land even when
placed in water
- added isBlockedVisitable and isCoastVisitable method to
CGObjectInstance
- implemented json config for these properties in banks
2023-06-25 17:42:33 +03:00