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

391 Commits

Author SHA1 Message Date
a6c3352d7c moved secondary skill default bonus initialization into CSkillHandler 2017-08-26 09:33:08 +12:00
0868164147 (int) -> static_cast<int> 2017-08-12 15:43:41 +03:00
8c0fab1dcf fixes 2017-08-12 14:36:37 +03:00
15138c23de Finished conversion to new logging API
* removed logger streams
* (float3|int3)::operator() -> (float3|int3)::toString(), it was too ugly and confusing.
2017-08-11 23:06:27 +03:00
61e241308d Logging cleanup 2017-08-10 19:52:05 +03:00
cb40c093f8 Avoid boost::optional assignment for Boost 1.64 compatibility (#360)
Two options here: to use emplace from 1.56 or boost::make_optional.
Unfortunately Ubuntu 14.04 is using 1.54 and I'd rather not to break it.
2017-08-05 16:09:29 +03:00
a4c0ad94b1 Code style: remove default value hints in definitions (#342)
Some are outdated and this is something IDE are useful for.
2017-07-15 14:08:20 +03:00
0cb6515ae8 VCAI tweaks (#311)
* Add extra priority support for town capture evaluation
* Improve building algorithm
* GatherArmy: check free gold instead of total for when hiring heroes
2017-07-15 01:15:08 +03:00
4f14f22d3a Unified CStack ammo, casts and counterattacks
* it is possible now to add casts and shoots OTF (f.e. with spell bonus)

Centralized stack 'ammo' loading from bonus system.
* introduced small proxy class for local bonus cache
(no need to use global cache if particular selector used on node only in one place)
* handle killing resurrected creatures
* use IBonusBearer::MaxHealth() where possible
* Fixed https://bugs.vcmi.eu/view.php?id=2486
* Possible fix for 0 HP after resurrection.
* Hack-fixed https://bugs.vcmi.eu/view.php?id=2584
* Unified CStack health API
* Use CHealth for CStack count and health points
* increased SERIALIZATION_VERSION
2017-07-08 20:29:59 +03:00
a31c28ec33 Unified war machine mechanics.
* it is possible to define new war machines
* added warMachine field to artifact configuration
2017-06-06 19:18:26 +03:00
9f1451c1a3 [Map format] more correct handling of default hero primary skills 2017-06-06 02:37:07 +03:00
4b2a118ffa fixed assertion if hero instance in VCMI map have 0 at one of primary skills 2017-06-06 02:01:24 +03:00
8a494b7820 fix 2017-05-28 18:42:36 +03:00
9718ef1543 Fix 2017-05-28 18:40:13 +03:00
70a092f58c [Refactoring] use virtual method for object specific actions when new map object is created
* --TODO
* fixes CID 1366291, CID 1366297
2017-05-28 16:23:42 +03:00
a85b4cf2a5 * WIP on event condition format
* Hero portrait serialization
* Fix town spells serialization

* Added support for float exponential part in Json
* Added support for int64 in Json
* Added basic Hero definitions serialization
* Added rumors serialization
* Advanced player info serialization.
* Added Disposed heroes serialization, (!) not covered with tests yet
* Added Local event serialization
* Added Pandoras box serialization
* Added Seer hut reward serialization
* Added CQuest serialization
* Added API for map object instance names serialization.
* Added random dwelling options serialization
* Advanced town options serialization
* Advanced hero options serialization
* More map format tests
* A lot of fixes, cleanup and refactoring
2017-05-27 00:23:19 +03:00
3de891b4b4 Moving/dividing classes from BattleState to separate files. 2017-03-17 16:48:44 +01:00
fa4e00573f Fixed CID 1366350 2016-11-25 15:34:38 +03:00
f538aae95e Partial fix for http://bugs.vcmi.eu/view.php?id=2590 2016-11-02 14:52:02 +03:00
552f28c10b fix 2016-10-11 21:25:22 +03:00
4173a5064c Fixed http://bugs.vcmi.eu/view.php?id=2545 2016-10-11 20:04:27 +03:00
799b8519e0 Allow cast avdmap spells without spellbook
* fixes http://bugs.vcmi.eu/view.php?id=1898
* partial fix for http://bugs.vcmi.eu/view.php?id=482
* fixes http://bugs.vcmi.eu/view.php?id=2155
2016-10-01 17:21:39 +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
ea2e336f54 Merge branch 'develop' into SpellsRefactoring8 2016-09-22 16:40:32 +03:00
635c48f889 CGHeroInstance::setType: fix to give proper subID to random heroes
Hero class id is used to determine hero object appearance, but after than we use subID to store it's unique id.
This change should fix issues 2127 and 2277 since random heroes not going to override others in heroesPool.
2016-09-18 10:01:09 +03:00
53fbf88316 Spell cast logging refactored. 2016-09-17 23:04:23 +03:00
505e53c17d Merge remote-tracking branch 'remotes/origin/develop' into SpellsRefactoring8
# Conflicts:
#	client/battle/CBattleInterface.cpp
#	lib/spells/BattleSpellMechanics.cpp
2016-09-12 10:13:40 +03:00
c8faca8f39 Refactoring: only use RNGs explicitly to avoid bug prone code in future
Now server-side code should always use CRandomGenerator::getDefault which is serialized in GH.
CGameState::getRandomGenerator should be only used from GS code and CPackForClient-based applyGs.
2016-09-11 00:10:46 +03:00
62abde6c46 Prepare battle log for spell-cast on server side. 2016-09-10 18:23:55 +03:00
ca819b3cda CGHeroInstance::nextPrimarySkill: don't use GS RNG directly
Code used from both GS and CGameHandler.
2016-09-09 23:16:42 +03:00
85f49bc968 CGHeroInstance::initArmy: don't use GS RNG. Get RNG through a ref
This function used by both server-side and gamestate so it's must use appropriate random source.
2016-09-09 23:16:42 +03:00
2ba3b20928 Multiple changes to RNG usage to both client and server
Server should never use RNG from CGameState directly.
Instead server get's own RNG that's state is secret for client.
2016-09-09 23:16:42 +03:00
206c5699cf CGHeroInstance::SecondarySkillsInfo: always set rand seed
Seed will always be set again on hero initialization, but for save sync it's must be same before that. Related to issue 2459
2016-08-19 23:31:54 +03:00
ab06cfd586 More fixes for uninitialized fields 2016-08-18 18:53:28 +03:00
b0045fa357 Fix TurnInfo memory leaks 2016-08-16 15:47:21 +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
dd1aabbe23 Use JsonSerializeFormat for map objects 2016-02-22 02:37:19 +03:00
800f32c4cb Fix few cases of tempOwner initialization. 2016-02-14 12:13:30 +03:00
709dd833d5 Added hacks for hero identification. 2016-02-14 11:25:01 +03:00
6db94ab74c Explicit army serialization - too much CArmedInstance descendants 2016-02-09 10:11:59 +03:00
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
1bc41b3ba3 Merge commit '3c844002626f48007a888d4dd8b0b45ec867fc9a' into feature/VCMIMapFormat1
Conflicts:
	lib/mapObjects/CGHeroInstance.cpp
2016-02-03 05:04:44 +03:00
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
918fbd8530 Refactor hero's mana regain 2016-01-30 13:51:07 +03:00
9f3313524e Fix 2160 dismissing a VIP hero 2016-01-27 17:10:19 +03:00
7772b6de74 Fix 981 reset hero on hiring after retreat/surrender 2016-01-26 22:48:31 +03:00
408f346541 Drafts for hero serialization 2016-01-24 15:35:08 +03:00
6f5c52a229 Refactoring: use cleaner CCreatureSet::stacksCount everywhere 2015-12-24 21:30:57 +03:00
59199ccdbd Bonus system: add treeHasChanged call where bonus objects changed 2015-12-11 16:13:18 +03:00
1730a31471 HeroBonus: get rid of code that used getBonusList 2015-12-11 16:01:51 +03:00