1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00
Commit Graph

160 Commits

Author SHA1 Message Date
3de891b4b4 Moving/dividing classes from BattleState to separate files. 2017-03-17 16:48:44 +01:00
7126bd61a4 Fixed CID 1197343 2016-12-05 03:12:11 +03:00
c4ab962cc0 Fixed a few CWE-457 2016-11-27 17:48:18 +03:00
baa7a84db3 Fix memory corruption during loading artifacts from mods 2016-10-22 10:00:55 +02:00
f124db9f61 Get rid of Bonus::sourceSpell()
* now bonus API looks more or less clean
2016-10-01 14:47:21 +03:00
c2a6c268c0 Cleanup terrain overlay bonuses, fixed CURSED_GROUND 2016-10-01 14:10:09 +03:00
b6368e23ab cleanup 2016-10-01 11:05:58 +03:00
f6bfba0ced Unified Dispell-related bonus selectors 2016-10-01 10:31:59 +03:00
96c17505ae get rid of IBonusBearer::getSpellBonuses & Selector::anyRange 2016-10-01 09:07:18 +03:00
c243ae6f3e Get rid of IBonusBearer::getEffect 2016-10-01 08:28:33 +03:00
a1ff409080 Tweak
* handle BIND_EFFECT by bonus type
2016-10-01 08:04:39 +03:00
04f7b4f951 Cleanup 2016-10-01 07:47:39 +03:00
730e3b6d0f Explicit use of limit selector in CBattleInfoCallback::getRandomBeneficialSpell
* reverted changes in IBonusBearer::hasBonusFrom just in case
2016-10-01 07:28:03 +03:00
902117d812 Get rid of IBonusBearer::getBonusesCount it had only one usage 2016-10-01 06:51:12 +03:00
2f7e10a06f Use range limit selector when modifying bonus lists and checking for spell bonuses
* fixes http://bugs.vcmi.eu/view.php?id=2532
2016-09-30 17:12:28 +03:00
245d17a9e9 Fixed typo bonus duration enum. Mod compatibility retained. 2016-09-30 01:57:33 +03:00
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
f4f170bf92 Merge pull request #202 from vcmi/noncopyableBonusSystemNode2
Didn't manage to find any crashes in newly created games. Merging.

Keep in mind that even if most of old saves will load properly some of them still corrupted beyond repair and after some turns they might eventually crash.
2016-09-04 11:06:05 +03:00
452e28d183 Remove some useless includes found by cppclean
This of course was tested and shouldn't break anything
2016-08-26 04:42:16 +03:00
69395d4c78 Fix bonus tree on node move 2016-08-18 15:04:07 +03:00
d42947f109 Added move constructor for BonusList 2016-08-18 15:04:05 +03:00
55e27a6334 Important fix 2016-08-18 15:04:03 +03:00
681b3c7078 reduced code duplication 2016-08-18 15:04:01 +03:00
629922f43e Added move constructors for minimum required Bonus system`s classes 2016-08-18 15:03:59 +03:00
89ce1a4509 Fixed uninitialized field 2016-08-18 15:03:20 +03:00
10dbbead2d Fix indentation of logging code and around it
That wouldn't be as big issue if problem affected few files, but it everywhere in codebase.
Fixed it everywhere since in most files that is the only code with wrong indentation.
2016-03-12 04:46:21 +03:00
9fd1cff090 Refactoring: always use std prefix for shared_ptr, unique_ptr and make_shared
Long time ago it's was used without prefix to make future switch from boost to std version easier.
I discusses this with Ivan and decide to drop these using from Global.h now.

This change wouldn't break anything because there was already code with prefix for each of three cases.
2015-12-29 05:43:33 +03:00
8fb5dacba2 CBonusSystemNode: get rid of non-const getBonusList 2015-12-11 15:02:36 +03:00
b48d65ad57 addNewBonus: add turnsRemain check for N_TURNS, N_DAYS and ONE_WEEK 2015-11-20 14:37:57 +03:00
7f0b0bd1b5 Bonus system: use updateBonuses in battleTurnPasseed 2015-11-09 15:48:07 +03:00
ee1c5e452f Bonus system: add CWillLastDays selector 2015-11-09 15:01:58 +03:00
5bfbd8526b Bonus system: fix N_DAYS bonus duration 2015-11-09 14:18:36 +03:00
b701835de0 Fix wrong comparison 2015-10-13 21:05:46 +03:00
395070b584 Fix 1974 2015-09-15 08:51:05 +03:00
8f2da66a18 fix mantiss 1967 + some refactoring
* remove TModDescr and realted APIs - they were only used in one place
2015-09-04 22:29:20 +03:00
2cb6cb7baa Remove useless durationType selector
* duration is a mask, equality comparison is not enough
2015-06-02 07:12:02 +03:00
5b29e800f7 Cleanup: use only CBonusSystemNode::treeHasChanged() when changing treeChanged 2015-04-11 08:13:28 +03:00
685deddac1 Start spell-relatet files reorganisation
* moved existing files to separate directory
-> todo: split mechanics
2015-02-26 08:39:48 +03:00
66b022f93e initializer lists part1 2014-10-02 19:43:46 +04:00
36a7cff998 Cleaning error messages at access to players. 2014-09-17 11:03:53 +02:00
5139378319 - migrated boost::function/ref/bind to std:: variants 2014-08-04 20:33:59 +02:00
dc03a251f6 - Fixed treasure generating formula It should be now identical to OH3.
- Refactorings, tweaks.
2014-07-29 15:58:54 +02:00
8a3b997fa5 fix a few comments. No code changes. 2014-05-21 13:02:20 +04:00
8683c8c0eb - Added and improved some propagators, including Crystal Dragons ability (#1232)
- Minor refactoring in AI
2014-03-29 21:39:19 +00:00
9c0df68cb8 Fixing spelling mistakes. Patch from josch, fixes #1759 2014-03-23 12:59:03 +00:00
3560bbb7f3 two patches/pull requests from janisozaur
- replace our custom bmap with std::map::at()
- compile fixes for editor
2013-11-12 10:45:42 +00:00
4ec9faa789 Fixed #1367. Removed confusing code for speed calculation. 2013-07-22 17:06:32 +00:00
4fd9bcfedc Fixed #1345 2013-07-22 10:39:11 +00:00
886ef13bec Levels for WoG neutral creatures - fixes #1282.
Renamed Myriad and Medusa Queen (sic?) to Arctic & Lava Sharpshooter.
2013-07-12 19:13:39 +00:00
a1f545792b Compile fixes specific for VS 2012"
* Reverted std::bind to boost::bind. std::bind on Visual 2012 doesn't work in some cases (especially with std::ref), not sure why [but it seems to be a bug, since 2013 preview compiles the same code fine]. 
 * Move assignment operator for VS 2012.
2013-07-02 15:23:32 +00:00