1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-19 21:10:12 +02:00

462 Commits

Author SHA1 Message Date
Ivan Savenko
3bbfee0e1c Fix usage of std::bitset 2025-01-31 11:41:44 +00:00
Ivan Savenko
313fa1e80e Remove commented-out code 2025-01-30 11:31:54 +00:00
Ivan Savenko
d8ec69bfaa Remove non-const iterators to BattleHexArray container
Replaced with several non-const methods to prevent modification of
internal storage without corresponding modification of internal flags
2025-01-29 23:02:51 +00:00
Ivan Savenko
5c8c69e665 Smarter logic for determining whether hex is inside the walls 2025-01-29 23:01:42 +00:00
Ivan Savenko
f4c3367e43 Workarounds for crashes from Google Play
- Do not crash on failure to read json from disk
- Add more debug information for crash on BattleHex access
2025-01-28 20:22:28 +00:00
Ivan Savenko
abc7168ff6 Consider units on wall hexes as 'inside' town for tower target selection 2025-01-26 15:51:54 +00:00
Ivan Savenko
112de6324f Do not show full damage range limit for units without range penalty 2025-01-26 15:51:09 +00:00
Ivan Savenko
f858a6e04b
Merge pull request from MichalZr6/battlefield
Minor fixes to BattleHexArray. BattleHex'es as const reference where possible.
2025-01-25 17:44:14 +02:00
Ivan Savenko
2ee5f2df02
Merge pull request from IvanSavenko/bugfixing
[1.6.4] Bugfixing for recently reported issues
2025-01-21 15:50:02 +02:00
MichalZr6
30bd975f95 Use unit->getHexes()
instead of battle::Unit::getHexes(stack->getPosition(), stack->doubleWide(), stack->unitSide())
2025-01-21 13:23:18 +01:00
MichalZr6
a1593948b7 Restore LF, use JsonKeys for logging, fix BattleHex description 2025-01-21 13:23:17 +01:00
MichalZr6
ecdd394bb1 Use BattleHex as const ref wherever possible
Minor Fixes
Drop unused function from BattleHexArray
2025-01-21 13:23:17 +01:00
MichalZr6
8f63a82d60 Minor changes with BattleHex and BattleHexArray 2025-01-21 13:23:17 +01:00
Ivan Savenko
2a16767cdc Fix FREE_SHOOTING bonus check (including war machines) 2025-01-18 19:49:30 +00:00
Ivan Savenko
b33b880482 Do not add dead units as 'adjacent', since all callers assume this 2025-01-18 19:48:59 +00:00
Ivan Savenko
e829d723b2 Replace global bonus tree change counter with per-node counter 2025-01-12 12:23:07 +00:00
Ivan Savenko
5bfc837a8f Fix regressions from battlehex PR (mostly related to towers) 2025-01-12 11:07:50 +00:00
Ivan Savenko
48473b18f6 move checks for invincible bonus to UnitState & cache 2025-01-10 21:15:37 +00:00
Ivan Savenko
40bff74195 Use small vector for unit list 2025-01-10 18:58:46 +00:00
Ivan Savenko
3b35c679ce Optimize Unit::getHexes method 2025-01-10 15:07:59 +00:00
Ivan Savenko
5375d61d1b Optimize battleAdjacentUnits method 2025-01-10 14:27:12 +00:00
Ivan Savenko
a44bbf4527
Merge pull request from MichalZr6/battle_hex_array
New container for BattleHexes. Refactors aiming for quick-battle better performance.
2025-01-10 15:32:05 +02:00
Ivan Savenko
e27ca391b1 Fix counter-attack counting 2025-01-08 16:06:31 +00:00
MichalZr6
dbe82b94f6 Changes following review:
- shared_ptr for destructibleEnemyTurns instead of raw pointer
- drop implicit int conversion for BattleHex class
  and implement toInt() instead
- implement necessary operators in BattleHex
- adjust code to work properly with JSON serializer
2025-01-08 07:24:43 +01:00
MichalZr6
4031006317 Drop battle elapsed time measurement, restore avHexes.
Github validation report fixes.
2025-01-06 23:28:47 +01:00
MichalZr6
dad6437661 Refactor BattleHex, remake the use of precomputed neighbouring tiles containers.
- Moved short, frequently used functions to the BattleHex header for inlining
- Made BattleHex a class with a private hex value
- Moved getClosestTile implementation back to BattleHex
- Enabled access to static precomputed data in BattleHexArray via BattleHex
(note: circular dependency prevented static precomputed containers being directly placed in BattleHex)
2025-01-06 23:28:46 +01:00
MichalZr6
ac8104d56d SonarCloud recomendations.
Code review follow-up:
- Replace std::vector with boost::small_vector
- Rename function merge to insert
2025-01-06 23:28:45 +01:00
MichalZr6
44a645b5e0 use bitset for presenceFlags and steady_clock for measurments 2025-01-06 23:28:45 +01:00
MichalZr6
794595184e use class scope static instead of function scope 2025-01-06 23:28:45 +01:00
MichalZr6
7a8edff419 minor fixes 2025-01-06 23:28:44 +01:00
MichalZr6
fb9a3da651 Unit.cpp refactor and some other minor changes 2025-01-06 23:28:44 +01:00
MichalZr6
e3516120d8 Refactor destructibleEnemyTurns 2025-01-06 23:18:20 +01:00
MichalZr6
8c3a417527 Cleanup 2025-01-06 23:18:20 +01:00
MichalZr6
78845706c9 GetClosestTile refactor 2025-01-06 23:18:19 +01:00
MichalZr6
5f799d41b3 Use cached neighbouring tiles where possible 2025-01-06 23:18:19 +01:00
MichalZr6
a99274d72e BattleHexArray - new container for BattleHexes 2025-01-06 23:18:18 +01:00
Ivan Savenko
73d1675ae3 Code cleanup, fixes to discovered regressions 2025-01-05 15:41:42 +00:00
Ivan Savenko
83b9a8d750 Fixes for regressions 2025-01-04 15:09:50 +00:00
Ivan Savenko
39d2f27589 Remove remaining usages of CCheckProxy class 2025-01-04 15:09:50 +00:00
Ivan Savenko
919588f7ff Added cache for common hero-based bonuses 2025-01-04 15:09:50 +00:00
Ivan Savenko
157d6d30c8 Move rest of commonly-accessed UnitState queries to bonus cache 2025-01-04 15:09:50 +00:00
Ivan Savenko
05397e2aaf Caching of bonuses that are requested with different durations 2025-01-04 15:09:50 +00:00
Ivan Savenko
16cfb51f3e Initial version of new bonus caching system 2025-01-04 15:09:50 +00:00
Ivan Savenko
5caf12f22f Few more fixes to bonus caching 2024-12-22 13:27:40 +00:00
Ivan Savenko
95a07ee5cb Use bonus system cache whenever possible 2024-12-21 18:47:11 +00:00
Ivan Savenko
4f80ccd648 Small micro-optimizations for code that gets called A LOT 2024-12-21 14:43:09 +00:00
Laserlicht
3c4064e09d prism attack fix 2024-11-23 02:10:01 +01:00
Ivan Savenko
c98ac01e7a Replaced public artType member of ArtifactInstance with getter 2024-10-30 16:47:01 +00:00
Ivan Savenko
db913d95e0
Merge pull request from Laserlicht/prism_breath
Bonus: prism breath
2024-10-28 12:29:41 +02:00
DjWarmonger
59a15c5ff0
Merge pull request from kodobi/bugfix/fix-incorrect-battlefield-while-attacking-town-without-fort
Fix battle setup for sieges without forts
2024-10-28 08:38:14 +01:00