1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00
Commit Graph

583 Commits

Author SHA1 Message Date
AlexVinS
c82afe7156 switch CMapService API to ResourceID 2017-06-04 22:42:48 +03:00
Alexander Shishkin
7e1b0d71c5 Added option for saving generated maps on client side (#307)
* new configuration option 'general.saveRandomMaps'
* maps being saved to 'userCachePath/RandomMaps'
* no deletion of old random maps
* map filename generated based on template name and random seed
2017-06-04 20:33:28 +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
3216422307 Fixed a few CWE-457 2016-11-27 22:07:01 +03:00
AlexVinS
8b4f1fc938 Fixed CID 1288850 2016-11-26 22:24:16 +03:00
AlexVinS
713403a0e4 Cleanup 2016-11-13 13:15:36 +03:00
Ivan Savenko
5b76c3f4eb Rebase of codebase changes for refactored serializer
Some of newer fixes not yet merged there and save compatibility a bit off.
2016-10-27 18:12:20 +03:00
AlexVinS
cd5c0b3297 Style tweaks. 2016-10-02 15:22:55 +03:00
Arseniy Shestakov
04eb0e3787 CGameState::battleGetBattlefieldType: avoid crash on tile 0,0,0
Fix issue 2524
2016-10-02 08:39:01 +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
dydzio
68af6a0c19 Refactoring InfoAboutHero + GetHeroInfo 2016-09-28 13:22:33 +02:00
dydzio
d831c087d9 Extending hero info callback
Allow to check battle enemy hero details + adding max spell points to available data
2016-09-27 22:47:24 +02:00
Arseniy Shestakov
c8090c78ec CGameState::updateRumor: fix infinite loop with only one map rumor 2016-09-15 23:22:25 +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
Arseniy Shestakov
70abae9b51 CGameState::battleGetBattlefieldType: use RNG by ref
For now I not sure about proper place for battleGetBattlefieldType so I left it in GS
2016-09-09 23:16:43 +03:00
Arseniy Shestakov
ea63497b19 Move CGameState::setupBattle code to CGameHandler::setupBattle
No reason to keep this code in GS.
2016-09-09 23:16:43 +03:00
Arseniy Shestakov
960d93ff5f CGameState: don't use RNG directly for easier desync debugging
Only access random generator via CGameState::getRandomGenerator
2016-09-09 23:16:42 +03:00
ArseniyShestakov
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
DjWarmonger
6791350975 Compile fix (operator = is ambiguous). 2016-08-30 07:50:38 +02:00
Arseniy Shestakov
668cd83ee5 More work on static variable desyncs 2016-08-29 23:07:52 +03:00
Arseniy Shestakov
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
AlexVinS
629922f43e Added move constructors for minimum required Bonus system`s classes 2016-08-18 15:03:59 +03:00
AlexVinS
b3e7e2e04a [WiP] Fix one case of bonus node copying. 2016-08-18 15:03:55 +03:00
AlexVinS
1c292205df More logging cleanup 2016-08-12 12:14:10 +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
a59f0c23ce Dedug tweaks 2016-02-13 17:16:00 +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
9f3313524e Fix 2160 dismissing a VIP hero 2016-01-27 17:10:19 +03:00
Vadim Markovtsev
40cb48d65e Replace std::remove_if with vstd::erase_if 2016-01-26 10:19:58 +03:00
AlexVinS
89d986fc6a Merge remote-tracking branch 'remotes/origin/develop' into feature/VCMIMapFormat1
Conflicts:
	lib/CArtHandler.h
	lib/mapObjects/MiscObjects.cpp
2016-01-24 15:39:41 +03:00
Arseniy Shestakov
725cce368f CGameState::initStartingBonus: fix amounts for wood and ore bonus
In original game when wood and ore bonus is choosen you always get same amount of both resources.
2016-01-15 20:36:16 +03:00
Arseniy Shestakov
383f754ed1 Starting gold bonuses must be always multiples of 100 2016-01-07 20:51:37 +03:00
AlexVinS
37d0dad70a Merge branch 'develop' into feature/VCMIMapFormat1
Conflicts:
	lib/CArtHandler.cpp
2016-01-01 20:28:52 +03:00
Arseniy Shestakov
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
Ivan Savenko
a051a08a46 Merge remote-tracking branch 'origin/issue/2306' into develop 2015-12-18 22:21:11 +02:00
ArseniyShestakov
05a34fb417 Use "Favorable" instead of "Favourable" everywhere for consistency
Original game of course used american english version so we stick to it.
2015-12-06 02:23:41 +03:00
AlexVinS
947edc0693 Merge branch 'develop' into feature/VCMIMapFormat1 2015-12-05 13:04:04 +03:00
AlexVinS
0fab319c73 Merge remote-tracking branch 'remotes/origin/develop' into issue/2306
s reverts commit fa8a282696.

Conflicts:
	AI/VCAI/VCAI.cpp

Conflicts:
	AI/VCAI/VCAI.cpp
	client/windows/CAdvmapInterface.cpp
	lib/CPathfinder.cpp
	lib/CPathfinder.h
2015-12-05 12:56:12 +03:00
AlexVinS
6552acdff6 Check coastal tile OTF 2015-12-05 12:36:29 +03:00
ArseniyShestakov
360ebcce7e Merge pull request #145 from vcmi/feature/tavernRumors
Tavern rumors and Thieves Guild fixes
2015-12-05 03:13:25 +03:00
Ivan Savenko
89bf3592e3 Likely fixed duplicated random heroes 2015-12-05 01:40:23 +02:00
ArseniyShestakov
d856fde73f Rumors: use enum instead of magic numbers and avoid potential crash 2015-12-04 22:58:14 +03:00
ArseniyShestakov
2a63ba148a Thieves Guild: fix tavern map object, lvl 0 when no taverns owned
We also now check not number of towns, but only towns that has tavern built. Also according to original mechanics all taverns always display information based on your number of taverns and not number of taverns of object owner.
2015-12-04 18:38:57 +03:00
ArseniyShestakov
3b3c49420f Thieves Guild: correct number of taverns to access information 2015-12-04 17:52:30 +03:00
ArseniyShestakov
a62ee65d72 Rumors: implement income checking via statsHLP::getIncome
This also fix income ranking in Thieves' Guild
2015-12-01 06:28:08 +03:00
ArseniyShestakov
ffcc5ccdd2 Rumors: implement support for grail terrain rumor 2015-12-01 04:57:52 +03:00
ArseniyShestakov
15273ac0f7 Rumors: avoid repeating of same rumor twice in a row
Multiple rumors of same type can go in a row, but not identical rumors.
2015-12-01 02:14:11 +03:00