1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-04 09:42:40 +02:00
Commit Graph

79 Commits

Author SHA1 Message Date
AlexVinS
8a494b7820 fix 2017-05-28 18:42:36 +03:00
AlexVinS
9718ef1543 Fix 2017-05-28 18:40:13 +03:00
AlexVinS
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
AlexVinS
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
FeniksFire
3de891b4b4 Moving/dividing classes from BattleState to separate files. 2017-03-17 16:48:44 +01:00
AlexVinS
fa4e00573f Fixed CID 1366350 2016-11-25 15:34:38 +03:00
AlexVinS
f538aae95e Partial fix for http://bugs.vcmi.eu/view.php?id=2590 2016-11-02 14:52:02 +03:00
AlexVinS
552f28c10b fix 2016-10-11 21:25:22 +03:00
AlexVinS
4173a5064c Fixed http://bugs.vcmi.eu/view.php?id=2545 2016-10-11 20:04:27 +03:00
AlexVinS
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
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
AlexVinS
ea2e336f54 Merge branch 'develop' into SpellsRefactoring8 2016-09-22 16:40:32 +03:00
Arseniy Shestakov
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
AlexVinS
53fbf88316 Spell cast logging refactored. 2016-09-17 23:04:23 +03:00
AlexVinS
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
Arseniy Shestakov
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
AlexVinS
62abde6c46 Prepare battle log for spell-cast on server side. 2016-09-10 18:23:55 +03:00
Arseniy Shestakov
ca819b3cda CGHeroInstance::nextPrimarySkill: don't use GS RNG directly
Code used from both GS and CGameHandler.
2016-09-09 23:16:42 +03:00
Arseniy Shestakov
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
Arseniy Shestakov
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
Arseniy Shestakov
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
Arseniy Shestakov
ab06cfd586 More fixes for uninitialized fields 2016-08-18 18:53:28 +03:00
Arseniy Shestakov
b0045fa357 Fix TurnInfo memory leaks 2016-08-16 15:47:21 +03:00
Arseniy Shestakov
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
AlexVinS
dd1aabbe23 Use JsonSerializeFormat for map objects 2016-02-22 02:37:19 +03:00
AlexVinS
800f32c4cb Fix few cases of tempOwner initialization. 2016-02-14 12:13:30 +03:00
AlexVinS
709dd833d5 Added hacks for hero identification. 2016-02-14 11:25:01 +03:00
AlexVinS
6db94ab74c Explicit army serialization - too much CArmedInstance descendants 2016-02-09 10:11:59 +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
AlexVinS
1bc41b3ba3 Merge commit '3c844002626f48007a888d4dd8b0b45ec867fc9a' into feature/VCMIMapFormat1
Conflicts:
	lib/mapObjects/CGHeroInstance.cpp
2016-02-03 05:04:44 +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
Vadim Markovtsev
918fbd8530 Refactor hero's mana regain 2016-01-30 13:51:07 +03:00
Vadim Markovtsev
9f3313524e Fix 2160 dismissing a VIP hero 2016-01-27 17:10:19 +03:00
Vadim Markovtsev
7772b6de74 Fix 981 reset hero on hiring after retreat/surrender 2016-01-26 22:48:31 +03:00
AlexVinS
408f346541 Drafts for hero serialization 2016-01-24 15:35:08 +03:00
Arseniy Shestakov
6f5c52a229 Refactoring: use cleaner CCreatureSet::stacksCount everywhere 2015-12-24 21:30:57 +03:00
ArseniyShestakov
59199ccdbd Bonus system: add treeHasChanged call where bonus objects changed 2015-12-11 16:13:18 +03:00
ArseniyShestakov
1730a31471 HeroBonus: get rid of code that used getBonusList 2015-12-11 16:01:51 +03:00
Ivan Savenko
c3ce4b25df Removed all #include's of CMap.h from headers.
To all - please, avoid #include's in headers as much as possible
This kills incremental build compile times
2015-12-02 21:05:10 +02:00
ArseniyShestakov
f55bfe41d6 Digging: implement digging status on right click. Fix issue 401
This is also fix possibility to dig on some non-blockable objects like event.
2015-11-29 12:34:23 +03:00
ArseniyShestakov
c45cd1f4c2 CGHeroInstance::getOutOffsets: temporary fix for boat summoning
Appropriate fix would require to get rid of convertPosition everywhere. Check issue 515 for more details.
2015-11-26 10:55:02 +03:00
ArseniyShestakov
438a444443 CGHeroInstance: move native terrain check into getNativeTerrain
That make it easier to use that code independently in TurnInfo
2015-11-21 13:32:45 +03:00
ArseniyShestakov
a375c86ea2 movementPointsAfterEmbark: get max move points from TurnInfo
Missed that when originally implemented TurnInfo.
Not pretties code, but boost performance a lot.
2015-11-21 12:46:59 +03:00
ArseniyShestakov
abc4ea272f TurnInfo: store all bonuses and use TileInfo for everything
Currently this going to break ONE_WEEK bonuses because those don't work with CWillLastDays selector.
2015-11-12 14:30:29 +03:00
ArseniyShestakov
9a63735c24 CPathfinderHelper: implement TurnInfo to avoid bonus re-checking
TurnInfo contain information about what movement-related bonuses and MP hero going to have on certain turn.
This way we can collect this information once for each turn so it's huge performance boost.
2015-11-10 14:26:45 +03:00
ArseniyShestakov
d3c8ca7c1c Pathfinding: implement duration checking for fly and water walking
Now pathfinder take into account different bonuses for different tuns. So if you only have FLYING_MOVEMENT bonus from Fly spell for one turn then pathfinder will only let you use air layer within one turn only.

That work for cost calculations too. Let's say you have two bonuses:
 - FLYING_MOVEMENT with 20% penalty for next 2 turns
 - FLYING_MOVEMENT with 40% penalty for 5 turns
Now pathfinder using correct penalty for each turn so movements in air layer going to be more expensive on 3-5 turns.
2015-11-09 19:57:26 +03:00
ArseniyShestakov
7eebcb9d60 Artifacts: replace few more ints by ArtifactID 2015-11-07 11:46:58 +03:00
DjWarmonger
621c62b44e Don't crash when spell school level is higher than 3 (which is another bug) 2015-10-31 21:15:40 +01:00
DjWarmonger
17071c6ec8 Merge pull request #125 from ArseniyShestakov/newMovementSystem
Okay, time to merge this.
2015-10-31 13:56:22 +01:00
ArseniyShestakov
226650582d Move base movement cost to GameConstants 2015-10-16 03:03:40 +03:00