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

53 Commits

Author SHA1 Message Date
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
63bcf7d83c Replaced most of usages of CRandomGenerator with vstd::RNG in library 2024-07-16 13:13:07 +00:00
02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02:00
7461df161c lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
186b6629c7 Do not hide roads behind objects 2024-05-01 12:15:07 +02:00
a94286c23d Code cleanup 2024-03-27 08:03:19 +01:00
19633a0f62 Build fixes 2024-03-27 06:48:22 +01:00
37f6993402 Clean the comments 2024-03-27 06:24:14 +01:00
d8c93cb222 Protect every access to zone tiles with a mutex 2024-03-27 06:16:48 +01:00
28f76b2839 Actually, avoid guarded object altogether 2024-03-01 18:17:17 +01:00
4e88290962 Actually avoid only monsters 2024-03-01 18:10:05 +01:00
8f1638f78a Try to not route roads through passable objects 2024-03-01 17:48:07 +01:00
7ce3553a6d Fix race condition when placing object at teh shore 2024-02-04 08:56:21 +01:00
a15366f5a5 Make IObjectInterface::cb non-static 2024-01-19 13:55:21 +02:00
f9e5d73014 Missed optimization case 2023-12-21 17:56:21 +01:00
d4216a9191 Fixed routing roads behind Sub Gates, Monoliths and Mines 2023-12-21 13:22:23 +01:00
d5f9de5beb Definitive solution for Corpse 2023-12-21 12:29:45 +01:00
c701d42781 Multiple optimizations to avoid copying and allocating tiles for rmg::Area 2023-12-18 13:52:03 +01:00
985a2682ae Place Monoliths at max distance in Junction zone 2023-12-18 11:12:52 +01:00
339627731c Fixes 2023-12-15 18:26:59 +01:00
d31789e745 Extra cache for search area 2023-12-13 22:13:42 +01:00
e5f60f063c - Check full object area for minimum distance requirement
- Add option to optimize both for max distance and custom weight
2023-12-12 07:40:54 +01:00
f17d8babc5 Do not route road through the Corpse 2023-12-07 12:57:39 +01:00
5ad682048f Fix 2023-12-06 21:47:20 +01:00
6cd19b81dd Working fir for Corpse issue:
- Do not place guard next to blockVis object, if possible
- Do not place two blockVis objects next to each other
2023-12-06 20:49:28 +01:00
abad4b01ce Remove explicit convesion to int in operators 2023-11-15 15:55:19 +02:00
2bf599bbee Merge pull request #3119 from Nordsoft91/rmg-fix
Fix crash caused by duplicated delete
2023-11-05 17:09:52 +02:00
04aeea9b68 use toEnum instead of getNum for switch'es 2023-11-03 19:20:25 +02:00
2b9c362d5b Explicitly convert identifier to underlying enumeration 2023-11-03 16:03:29 +02:00
35e7fbb366 Fix crash cause by duplicated delete 2023-10-28 22:22:30 +02:00
ce62ab3e66 Select random object template instead of first 2023-09-30 01:19:18 +02:00
abacb5f0ea Fix resources placed behind mines 2023-08-12 10:53:25 +02:00
8f450cf253 Fix for monsters spawning at left side of the map 2023-08-11 18:43:22 +02:00
0252d0f986 Fix hota offset + 2 possible crashes 2023-08-11 07:45:24 +02:00
44fae4945d Update distances in all zones adjacent to object 2023-08-02 20:41:29 +02:00
1762df2b77 Formatting 2023-07-21 14:55:49 +02:00
545f047cae Fix HoTA guard once again
(cherry picked from commit 138a7c8024573f46962ad0f6e8e03ba53fa56076)
2023-07-18 19:28:20 +02:00
a968903c51 Fix HoTA guard offset in RMG 2023-07-14 16:45:13 +02:00
27c4882237 Compile fix 2023-07-07 21:40:55 +02:00
1cad64c470 Move road flag to placeObject() method 2023-07-07 20:17:20 +02:00
0d3ac4a502 - Add new option for connection
- Store info about objects and roads in RequiredObjectInfo
2023-07-06 22:15:00 +02:00
a560eaea51 Merge pull request #2237 from vcmi/fictive_connections
Wide, fictive, repulsive connections
2023-06-25 19:57:08 +02:00
43d666a2ff Refactor duplicated code 2023-06-25 18:31:54 +02:00
6f743916db Moved CGCreature to a new file 2023-06-20 19:37:27 +03:00
8510af487e Place objects away from wide connection 2023-06-18 19:20:12 +02:00
1bb2b5b571 + Maintain clear perimeter of a treasure pile.
+ Make sure that separate blocked areas remain unconnected so it's possible to pass between them.
2023-06-10 14:56:03 +02:00
66b6fba51f Use all tiles covered by treasure pile to determine distance to other treasures. 2023-06-08 19:31:38 +02:00
e98a50b45a Merge pull request #2123 from Warzyw647/rmg-split-enum-monster-strength
Refactor enums and add zone monster strength "none" in rmg
2023-06-06 20:40:35 +02:00
d6a357fd17 Split some map object files into smaller files. Reduced includes usage. 2023-06-02 21:47:37 +03:00
acac42291e Remove excessive CMap.h includes 2023-05-31 23:18:38 +03:00