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

116 Commits

Author SHA1 Message Date
Dmitry Orlov
39de2f6435 Fix: Morale bonus should be shown correctly 2020-11-11 22:43:40 +03:00
John Bolton
a05ae78e67 Fixed lots of warnings.
Disabled the following (for MSVC only) that couldn't (or shouldn't) be fixed.

4003: not enough actual parameters for macro 'identifier'
4250: 'class1' : inherits 'class2::member' via dominance
4251: 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
4275: non dll-interface class 'type1' used as base for dll-interface class 'type2'
2020-10-04 02:20:18 -07:00
John Bolton
6d8f1e4530 Fixed incorrect usage of const std::shared_ptr. Resolves 0003142.
Replaced const TBonusListPtr with TConstBonusListPtr where necessary
Replaced const std::shared_ptr<T> with std::shared_ptr<const T> where necessary.
Removed superfluous use of const.
Replaced const std::shared_ptr<T> with const std::shared_ptr<T> & in function parameters and ranged for-loops.
2020-09-30 22:56:28 -07:00
Dmitry Orlov
5e0023704b Fix PQ issues while calculating paths 2020-09-22 00:19:40 +03:00
Dydzio
f8c294ad0b Fix attack cursor on guarded visitable object 2019-07-14 13:25:06 +03:00
AlexVinS
da20aa2388 Use the same cost value in Pathfinder and fuzzy evaluations. 2019-01-17 10:54:41 +03:00
AlexVinS
4b5910c2f4 VCAI performance improvements
* Node graph initialization optimized.
* Fixed "Unathorized obstacle access".
* Pathfinding tracing disabled with ifdef.
* Misc bonus calculation optimizations.
* Removed timestamp from log lines. Date formatting eats too much CPU.
* Paths for all heroes in Client are now cached
2019-01-17 10:50:56 +03:00
Andrii Danylchenko
8fee46de7c AI: town portal support 2019-01-17 10:40:23 +03:00
DJWarmonger
f4a8a1294e Optimizations based on MSVS profiler. 2018-12-16 15:46:48 +01:00
Andrii Danylchenko
72aff02418 AI pathfinding: buy boat 2018-10-21 14:17:55 +03:00
Andrii Danylchenko
cbaa834589 AI pathfinding: bug fix after refactoring 2018-10-10 14:51:57 +03:00
Andrii Danylchenko
f327c46fa3 AI pathfinding: rename and add const to functions 2018-10-07 14:51:27 +03:00
Andrii Danylchenko
49c872e4ec AI: replace SectorMap with new PathfinderManager 2018-10-06 16:35:31 +03:00
Andrii Danylchenko
eb17313f7f AI: pathfinder extensibility - add one more rule for movement to destination and some refactoring 2018-09-23 15:26:53 +03:00
Andrii Danylchenko
7150fc9f71 AI: pathfinder api supports configuration 2018-09-23 15:26:53 +03:00
Andrii Danylchenko
9ab44b950a AI: pathfinder rework, rules refactored a bit. 2018-09-23 15:26:53 +03:00
Andrii Danylchenko
24221f3fb4 AI: move teleportation handling to pathfinder helper and neighbour finder 2018-09-23 15:26:53 +03:00
Andrii Danylchenko
6ac987794c AI: first rule extracted for pathfinder 2018-09-23 15:26:53 +03:00
Andrii Danylchenko
9af0032f84 AI: try to add some pathfinder extensibility. Extracted neighbour nodes finder 2018-09-23 15:26:53 +03:00
Ivan Romanov
eea50a044c Hide "this statement may fall through" warnings 2018-02-10 22:27:00 +05:00
Arseniy Shestakov
e9bfbb70c1 Ambient sounds: implement chebyshev distance for getTilesInRange 2018-01-02 09:48:17 +01:00
AlexVinS
143ff682bc Logging cleanup 2017-08-10 21:59:55 +03:00
AlexVinS
61e241308d Logging cleanup 2017-08-10 19:52:05 +03:00
Arseniy Shestakov
f1e5797834 Code style: move or add licensing information on top of every file 2017-07-14 01:26:03 +03:00
AlexVinS
3216422307 Fixed a few CWE-457 2016-11-27 22:07:01 +03:00
Vadim Markovtsev
2c1dddde33 Fix memory problems with BonusList
Bonus * -> std::shared_ptr<Bonus>

This cures the following problems:

1) Memory corruption at exit. Some Bonus-es were deleted twice (mods?).
2) Memory leaks. Some Bonuses were not deleted.
3) Reduce the number of "Orphaned child" messages.

Valgrind reports 0 leaked memory now and no invalid reads/writes.
2016-09-29 15:08:00 +02:00
Arseniy Shestakov
b0045fa357 Fix TurnInfo memory leaks 2016-08-16 15:47:21 +03:00
Arseniy Shestakov
b4a35f9c62 CPathfinderHelper: fix memory leak 2016-08-16 14:59:16 +03:00
Arseniy Shestakov
30189a386f CPathfinder: fix and improve sail-land transition checks 2016-02-26 21:43:43 +03:00
AlexVinS
6e205a58b4 Merge remote-tracking branch 'remotes/origin/develop' into feature/VCMIMapFormat1
Conflicts:
	lib/VCMI_lib.cbp
	lib/filesystem/CZipLoader.cpp
	lib/filesystem/CZipLoader.h
	lib/mapObjects/CGTownInstance.cpp
2016-02-04 10:27:51 +03:00
Vadim Markovtsev
3926920103 Rename radious -> radius
There is no such English word, "radious"
Some files get new lines in the end - BSD sed bug + best practices
2016-01-31 18:01:58 +03:00
AlexVinS
37d0dad70a Merge branch 'develop' into feature/VCMIMapFormat1
Conflicts:
	lib/CArtHandler.cpp
2016-01-01 20:28:52 +03:00
ArseniyShestakov
9490a5d66d CPathfinder: deny transit to land blockvis objs from water layer
When hero is in water walking layer he can only exit to accessible or visitable land tiles, but not objects that have blocking visit and leave hero standing on water.
This is different than default flying behaviour because hero in air layer can only transit into accessible land layer without any blocking or visitable objects on them.
2015-12-16 20:14:36 +03:00
ArseniyShestakov
bf9ac7318a CPathfinder: change cost calculation sequence for embark / disembark
With old embark cost calculation pathfinder may end up thinking that hero can embark/disembark while have less movement points than base movement cost is. Now hero would be only able to embark / disembark if we have enough movement points to step on that tile. This rule is also valid for situation when hero have Admiral's Hat as in H3 even if hero don't have embark penalty he still use move points for embark and disembark.

Problem was found as it's was causing infitite loop in AI. Server of course rejected attempt to embark with less than 100 movement points while pathfinder tell AI that it's can still embark with 93 movement points.
2015-12-15 20:08:52 +03:00
ArseniyShestakov
2724a67a27 CPathfinder: add border gate support and use passableFor 2015-12-14 14:33:50 +03:00
ArseniyShestakov
ab92123da3 CPathfinder: improve support for visits and battles in teleports
Related movement code for client and AI is plumbed as well. Though at moment code still not finished because it's not teleport hero to the exit tile if he won battle.
2015-12-11 09:42:30 +03:00
ArseniyShestakov
a430769b44 CPathfinder: fix possible crash when using invisible teleport exit
This one is similar with FoW bug when hero was covered by FoW while one tile around wasn't.
2015-12-11 04:10:30 +03:00
ArseniyShestakov
c3e5231146 CPathfinder: avoid pathing through hero standing on Subterranean Gate
Subterranean Gates unlike Monolith allow to visit hero standing on other exit. So of course pathfinder allowed that, but it's also allowed future movement through that hero which caused infinite loop for AI.
2015-12-10 16:51:19 +03:00
ArseniyShestakov
05a34fb417 Use "Favorable" instead of "Favourable" everywhere for consistency
Original game of course used american english version so we stick to it.
2015-12-06 02:23:41 +03:00
AlexVinS
947edc0693 Merge branch 'develop' into feature/VCMIMapFormat1 2015-12-05 13:04:04 +03:00
AlexVinS
6552acdff6 Check coastal tile OTF 2015-12-05 12:36:29 +03:00
ArseniyShestakov
9e7e5b81e4 Merge pull request #143 from vcmi/feature/patrolSupport
Patrol support for AI heroes
2015-12-05 03:11:07 +03:00
ArseniyShestakov
82ce58eceb CPathfinder::initializePatrol: don't pass valid PlayerColor
It's break getTilesInRange with mode 0 and we don't really need to check visibility anyway.
2015-12-05 01:45:10 +03:00
ArseniyShestakov
bdc369ffba Patrol: use manhattan distance for getting tiles in radius 2015-12-04 21:08:09 +03:00
Ivan Savenko
7b5a7f43ad Removed includes of CGameState from headers 2015-12-02 21:39:53 +02:00
ArseniyShestakov
6bb205b15b CPathfinder: patrol support using getTilesInRange
For now we use getTilesInRange which isn't really correct for patrol, but good enough for first version.
2015-11-28 20:34:50 +03:00
ArseniyShestakov
df4515901d CPathfinder: fix special movement boundary check
Forgot to fix it for water walking after fe12b8f664
2015-11-23 14:11:08 +03:00
ArseniyShestakov
f4c06660e4 CPathfinder::evaluateAccessibility: apply more optimizations 2015-11-22 21:31:47 +03:00
ArseniyShestakov
2632389aaf CPathfinder: bring FoW reference back to avoid performance loss
This one is revert 148355908d
2015-11-22 21:06:37 +03:00
ArseniyShestakov
6dacb84404 CPathfinder::addNeighbours: avoid allocating new vector each time 2015-11-22 07:32:33 +03:00