1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-10 09:50:17 +02:00
Commit Graph

3357 Commits

Author SHA1 Message Date
AlexVinS
6d13c8938c Silence "X doesn't have a base stack!" warning 2016-11-18 15:52:45 +03:00
AlexVinS
931656f24a possible fix for http://bugs.vcmi.eu/view.php?id=2612 2016-11-18 14:27:20 +03:00
AlexVinS
f8bf2c3746 Fixed http://bugs.vcmi.eu/view.php?id=2611 2016-11-18 12:56:58 +03:00
AlexVinS
713403a0e4 Cleanup 2016-11-13 13:15:36 +03:00
AlexVinS
4ff4e41e81 fixed typo 2016-11-13 13:13:41 +03:00
AlexVinS
2aa8c79a2c fixed boost::optional load, regression from https://github.com/vcmi/vcmi/pull/212 2016-11-13 11:46:26 +03:00
Alexander Shishkin
a73ca79ed1 Merge pull request #257 from vcmi/mapHandlerRefactoring2
Map handler refactoring, part 2.
2016-11-12 09:20:45 +03:00
dydzio
5c07e1c432 Minor typo fixes 2016-11-10 11:51:47 +01:00
AlexVinS
a8a661b159 Map handler refactoring, part 2. 2016-11-08 00:19:53 +03:00
AlexVinS
aad675a7c4 Revert "Merge branch 'p254_4' into develop"
This reverts commit 37f68713a7, reversing
changes made to 4477b7c35d.
2016-11-08 00:17:20 +03:00
AlexVinS
46196daa07 cleanup 2016-11-06 05:27:56 +03:00
AlexVinS
f538aae95e Partial fix for http://bugs.vcmi.eu/view.php?id=2590 2016-11-02 14:52:02 +03:00
DjWarmonger
db13d7a708 Version 0.99 updates. 2016-11-01 18:25:09 +01:00
DjWarmonger
9db3bfcbf2 Merge pull request #212 from vcmi/refactoring/serialization2
Apparently it works - both new and old saves load at least.
2016-11-01 17:25:39 +01:00
DjWarmonger
aa0c745202 Compile fixes for MSVS. 2016-11-01 16:48:34 +01:00
AlexVinS
dad0569bc7 Relaxed cast requirements for Quicksand 2016-10-31 15:38:53 +03:00
Arseniy Shestakov
e79c522c4b Serializer refactoring: fix FileStream usage for game loading
Miss this one rebase. Without this one non-English characters in paths to saves cause issues.
2016-10-30 15:46:44 +03:00
Ivan Savenko
a1cca251ec Possible fix for selection of incorrect method for serialization of vector<bool> 2016-10-30 11:42:53 +02:00
Vadim Markovtsev
99a3a58cbb Add commander resurrection info window upon entering town 2016-10-29 21:55:00 +02:00
Arseniy Shestakov
e13f98e38e Compilation fix for VS2015 suggested by Ivan and tested by @dydzio0614
It's compiled without it by Clang / GCC, but not MSVC++
2016-10-29 21:29:25 +03:00
Ivan Savenko
256f43f467 Fixes zero-initialized fileVersion member in deserializer 2016-10-29 19:52:19 +03:00
Vadim Markovtsev
9f967b4d7a Fix formatting 2016-10-29 17:00:12 +02:00
Arseniy Shestakov
ba5ad286cd Serializer refactoring: fix paths to work in Visual Studio 2016-10-28 13:52:42 +03:00
Vadim Markovtsev
c696746017 Fix some compilation warnings 2016-10-28 08:07:05 +02:00
AlexVinS
3a040c1730 Updated project files 2016-10-27 19:18:52 +03:00
Arseniy Shestakov
ba1929728a Drop old now unused serializer files 2016-10-27 18:44:00 +03:00
Arseniy Shestakov
5f1254a29e Apply some of Vadim's changes
I intentionally didn't transfer changes in CLoadIntegrityValidator since not really agree with them.
2016-10-27 18:39:17 +03:00
AlexVinS
8f349b5105 CTypeList: Apply changes from a50a32405d
Use weak_ptr for TypeDescriptor cross-links. Fixed total TypeDescriptor memory leak.
2016-10-27 18:12:30 +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
Ivan Savenko
3d1b1f4ba8 Add files for rebased serializer refactoring done by Ivan 2016-10-27 17:26:22 +03:00
AlexVinS
1ccb0d98be Disabled git version of C::B projects 2016-10-27 16:27:10 +03:00
Vadim Markovtsev
da1c9cf249 Fix rebuilding everything on HEAD change 2016-10-23 16:56:53 +02:00
Vadim Markovtsev
d0beb27197 Add git commit hash into the version string 2016-10-23 15:45:47 +02:00
Vadim Markovtsev
4bcc43d3d0 Fix Mantis #2234
CPlayerInterface instances were removed from CClient::playerint with
clear() and finish() was not called on each. Added multiple insurance.
2016-10-22 16:22:00 +02:00
Vadim Markovtsev
baa7a84db3 Fix memory corruption during loading artifacts from mods 2016-10-22 10:00:55 +02:00
Alexander Shishkin
4876cc178d Merge pull request #240 from vcmi/spellWindowRewrite
Spell window rewrite
2016-10-17 07:58:56 +03:00
AlexVinS
bc2f0ba6f1 fixed spell school ordering http://bugs.vcmi.eu/view.php?id=91 2016-10-17 03:33:29 +03:00
Vadim Markovtsev
89f506658e Fix issue #2068 - maps list update 2016-10-16 22:15:37 +02:00
AlexVinS
153af6e07b cleanup 2016-10-16 02:47:03 +03:00
AlexVinS
f760e22707 Fixed two recursive infinite loops in case of alternate buildings.
* introduced in https://github.com/vcmi/vcmi/pull/211
2016-10-15 04:19:47 +03:00
AlexVinS
cf143cd257 Hack-fix crash in CGTownInstance::genBuildingRequirements related to alternate town buildings
* this disables features of #211, but actual problem may be deeper inside logical expressions
2016-10-14 23:46:24 +03:00
Vadim Markovtsev
76ac9991ed Format code 2016-10-12 17:22:35 +02:00
AlexVinS
552f28c10b fix 2016-10-11 21:25:22 +03:00
AlexVinS
ef9bff9006 fixes related to http://bugs.vcmi.eu/view.php?id=2520 2016-10-11 20:04:30 +03:00
AlexVinS
9834db1b7d simplified CGScholar::onHeroVisit 2016-10-11 20:04:28 +03:00
AlexVinS
4173a5064c Fixed http://bugs.vcmi.eu/view.php?id=2545 2016-10-11 20:04:27 +03:00
AlexVinS
24585cde87 complete fix for http://bugs.vcmi.eu/view.php?id=2507 2016-10-11 18:19:42 +03:00
AlexVinS
5c3f84138b fixed random reward generation in CGVisitableOPW 2016-10-11 18:00:54 +03:00
AlexVinS
7db7ece143 Do not send netpack inside netpack handler. 2016-10-09 19:38:13 +03:00
Piotr Wójcik
bb890098df Fix regression for week-visitable objects 2016-10-09 18:51:41 +03:00
Hao Hu
9ec9cffe9b Bug fix for berserk: fixed the issue that the berserk affected stack
won't attack the nearest live stack.
2016-10-07 23:50:34 -04:00
Vadim Markovtsev
34cf92cb9b Change logging style 2016-10-03 20:32:01 +02:00
Vadim Markovtsev
eac5aab396 Survive client<->server ABI mismatch 2016-10-02 22:45:00 +02:00
Vadim Markovtsev
a4e550e3cf Add log levels report 2016-10-02 22:45:00 +02:00
ArseniyShestakov
6f82dc3e15 Merge pull request #230 from dydzio0614/CommanderExperience
Some repair for WoG commanders
2016-10-02 19:29:55 +03:00
Dydzio
b84e680f57 Revert changing class structure 2016-10-02 16:57:26 +02:00
dydzio
02e795d508 Fix commander appearing in battles while dead 2016-10-02 16:25:20 +02:00
AlexVinS
5fa9d64d78 Do not allow cast if it affects only "wrong" targets 2016-10-02 16:46:04 +03:00
AlexVinS
cd5c0b3297 Style tweaks. 2016-10-02 15:22:55 +03:00
AlexVinS
34a494ade0 hack-fixed http://bugs.vcmi.eu/view.php?id=2533 2016-10-02 12:39:25 +03:00
AlexVinS
affbc71c56 cleanup 2016-10-02 11:58:53 +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
AlexVinS
c5440a1c6c Fixed http://bugs.vcmi.eu/view.php?id=2541 2016-10-02 01:32:28 +03:00
AlexVinS
8aa57f0cbc fix 2016-10-02 01:07:13 +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
AlexVinS
f124db9f61 Get rid of Bonus::sourceSpell()
* now bonus API looks more or less clean
2016-10-01 14:47:21 +03:00
AlexVinS
c2a6c268c0 Cleanup terrain overlay bonuses, fixed CURSED_GROUND 2016-10-01 14:10:09 +03:00
AlexVinS
b6368e23ab cleanup 2016-10-01 11:05:58 +03:00
AlexVinS
f6bfba0ced Unified Dispell-related bonus selectors 2016-10-01 10:31:59 +03:00
AlexVinS
96c17505ae get rid of IBonusBearer::getSpellBonuses & Selector::anyRange 2016-10-01 09:07:18 +03:00
AlexVinS
c243ae6f3e Get rid of IBonusBearer::getEffect 2016-10-01 08:28:33 +03:00
AlexVinS
a1ff409080 Tweak
* handle BIND_EFFECT by bonus type
2016-10-01 08:04:39 +03:00
AlexVinS
04f7b4f951 Cleanup 2016-10-01 07:47:39 +03:00
AlexVinS
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
AlexVinS
902117d812 Get rid of IBonusBearer::getBonusesCount it had only one usage 2016-10-01 06:51:12 +03:00
AlexVinS
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
AlexVinS
887794e88b Remove UNTIL_BEING_ATTACKED bonuses after any received damage.
* fixes http://bugs.vcmi.eu/view.php?id=2528
2016-09-30 02:09:02 +03:00
AlexVinS
245d17a9e9 Fixed typo bonus duration enum. Mod compatibility retained. 2016-09-30 01:57:33 +03:00
AlexVinS
8aa31f4073 Fixed http://bugs.vcmi.eu/view.php?id=2529 2016-09-30 01:54:40 +03:00
AlexVinS
72461c5c2e Fixed http://bugs.vcmi.eu/view.php?id=2268 2016-09-29 23:14:22 +03:00
AlexVinS
9097ffbd8a Handle HYPNOTIZE effect in case of FEAR and ENCHANTED effects 2016-09-29 22:26:28 +03:00
AlexVinS
83b3c700dd Handle HYPNOTIZE effect in case of mana drain 2016-09-29 21:47:41 +03:00
AlexVinS
688dc4c189 tweaks 2016-09-29 19:37:59 +03:00
AlexVinS
d195bfb62d Possibly fixed http://bugs.vcmi.eu/view.php?id=2291 2016-09-29 18:55:07 +03:00
AlexVinS
fed26e1ac9 Merge remote-tracking branch 'remotes/vmarkovtsev/BonusList-shared_ptr' into develop
# Conflicts:
#	lib/spells/CDefaultSpellMechanics.cpp
2016-09-29 17:12:05 +03:00
AlexVinS
7ce33bc07a Dispell fixes 2016-09-29 16:50:33 +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
d79e336e4b Reworked SetStackEffect::applyGs
* fixed applying different duration effects from spells (f.e. Blind)
* reduced code duplication
2016-09-29 15:23:28 +03:00
AlexVinS
34b8b2c91b Fixed Berserk spell effect aka Bonus::ATTACKS_NEAREST_CREATURE
* issue http://bugs.vcmi.eu/view.php?id=2513
* fix is not retroactive
2016-09-29 14:11:15 +03:00
AlexVinS
e91a6d45e8 Probably fixed http://bugs.vcmi.eu/view.php?id=2523 2016-09-29 10:45:22 +03:00
DjWarmonger
e77d408e92 Merge pull request #222 from dydzio0614/HeroBattleWindow
Looks OK to me, thanks! :)
2016-09-28 21:06:59 +02:00
dydzio
68af6a0c19 Refactoring InfoAboutHero + GetHeroInfo 2016-09-28 13:22:33 +02:00
AlexVinS
30aa379a9d Fixed http://bugs.vcmi.eu/view.php?id=2521
* show icons at visitable position
* do not duplicate visible objects icons
2016-09-28 07:58:15 +03:00
dydzio
f9b5ca3374 Remove max mana info leak + tiny refactor 2016-09-28 00:20:45 +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
AlexVinS
a03419e7d9 Fixed http://bugs.vcmi.eu/view.php?id=2269 2016-09-24 11:25:29 +03:00
AlexVinS
7874dffa7d fixed http://bugs.vcmi.eu/view.php?id=2282 2016-09-24 10:06:24 +03:00
AlexVinS
849e3fc04e Fixed http://bugs.vcmi.eu/view.php?id=2506 2016-09-24 09:27:58 +03:00
ArseniyShestakov
6c63041d1a Merge pull request #198 from vcmi/SpellsRefactoring8
No reason to not merge this now.
2016-09-24 05:29:55 +03:00
AlexVinS
7618e294c2 More fixes to not place obstacles on wall parts 2016-09-24 04:55:48 +03:00
AlexVinS
cffc4b2ab5 fixed patch obstacle placement inside walls 2016-09-23 20:27:55 +03:00
AlexVinS
bac0b026e5 Do not place obstacles on wall parts 2016-09-23 13:14:12 +03:00
AlexVinS
44753866ec Fixed Clone links cleanup. 2016-09-23 12:20:41 +03:00
Arseniy Shestakov
bb05db90e5 CRewardableObject::onHeroVisit: avoid crash on pickable objects
Missed this problem when tested #214
2016-09-23 11:47:07 +03:00
ArseniyShestakov
50b271393c Merge pull request #214 from Chocimier/iss1975
Properly check if corpse was visited
2016-09-23 06:26:10 +03:00
AlexVinS
ea2e336f54 Merge branch 'develop' into SpellsRefactoring8 2016-09-22 16:40:32 +03:00
Piotr Wójcik
97d358b70f Marking visited for team
Also no longer gives reward every player
2016-09-20 22:05:44 +02:00
Dydzio
bd651ec5ef Improve pandora box secondary skill handling 2016-09-20 12:40:58 +02:00
Dydzio
563a5d53c0 Update secondary skill handling. Fix issue 2307
Also making secondary skill icon display behavior same as in H3 during popup message.
2016-09-19 20:05:57 +02:00
Dydzio
8b0c62e10e Block surrender via escape tunnel. Fix issue 2389 2016-09-18 22:05:05 +02:00
AlexVinS
7e85154946 Unify battleCanCastSpell parameters 2016-09-18 18:12:07 +03:00
AlexVinS
ef34d21941 Passive cast can be blocked by spell level limit. 2016-09-18 17:21:56 +03:00
AlexVinS
374e30c972 Added a few safety checks 2016-09-18 16:30:03 +03:00
AlexVinS
73c7b49eb7 Hide effectValue calculation inside BattleSpellCastParameters 2016-09-18 15:27:22 +03:00
AlexVinS
1fd87ecc4a Simplified offensive spell damage calculation 2016-09-18 14:54:17 +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
Arseniy Shestakov
f6df107a55 Replace more magic subIDs with readable enums 2016-09-18 00:53:37 +03:00
Dydzio
beae354536 Correcting random amount of gold in gold piles
In original H3 allowed amounts of gold in treasure piles are multipliers of 100. Before this fix gold amount can be any value from range 500-1000.
2016-09-17 23:22:13 +02:00
AlexVinS
53fbf88316 Spell cast logging refactored. 2016-09-17 23:04:23 +03:00
AlexVinS
d993710f8e Merge branch 'develop' into SpellsRefactoring8 2016-09-17 20:29:44 +03:00
Piotr Wójcik
28d859419c Revert the old code 2016-09-16 22:01:21 +02:00
Piotr Wójcik
29d6fb0f04 Properly check if corpse was visited
Fixes two issues:
- corpse without loot couldn't be marked as visited
- taking loot from once visitable objects marked them as visited for all players
2016-09-16 20:59:07 +02:00
Arseniy Shestakov
84137dcaa5 Add DLL_LINKAGE to getStr and fix player id logging in VCAI 2016-09-16 05:45:00 +03:00
Arseniy Shestakov
c8090c78ec CGameState::updateRumor: fix infinite loop with only one map rumor 2016-09-15 23:22:25 +03:00
Arseniy Shestakov
fdca75b4b0 PlayerColor: add getStr and getStrCap functions with optional L10n 2016-09-15 18:22:54 +03:00
ArseniyShestakov
b5fa97b697 Merge pull request #211 from Chocimier/iss2321
Tested. Everthing looks fine so merging.
2016-09-14 00:37:17 +03:00
Piotr Wójcik
c5e4eaf9c1 Check if hero knows spell even without wisdom 2016-09-13 22:28:21 +02:00
Arseniy Shestakov
1e60ba6516 Only delete CQuest in CMap destructor and not with IQuestObject
Quest information must remain accessible even if map object removed. Fix issue 2472
2016-09-13 01:30:47 +03:00
Piotr Wójcik
e1a1bc89c0 Extract PossibilityVisitor 2016-09-12 22:28:11 +02: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
ArseniyShestakov
2543e068ac Merge pull request #209 from vcmi/fix/saveDesyncs
Think I tested it enough to merge it
2016-09-11 21:36:42 +03:00
AlexVinS
33d1895d21 Merge branch 'develop' into SpellsRefactoring8 2016-09-11 18:34:18 +03:00
AlexVinS
49e2bde3c0 Mostly complete fix for http://bugs.vcmi.eu/view.php?id=2429 2016-09-11 16:02:45 +03:00
AlexVinS
3fa62beb6d Do not allow to cast Cure if there is nothing to cure. 2016-09-11 13:48:14 +03:00
Arseniy Shestakov
fe6c0cf89b Use RandomGeneratorUtil::randomShuffle for reproducible gameplay 2016-09-11 00:10:52 +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
5e0a9d7966 hackfix for commander spells 2016-09-10 22:41:50 +03:00
AlexVinS
4a9978c642 Disabled massive spells fore creatures as they are not fully supported yet.
* (WoG) commanders now cast spells properly.
2016-09-10 21:07:36 +03:00
Piotr Wójcik
40003460ca Check if building's dependencies are allowed 2016-09-10 19:38:49 +02:00
AlexVinS
62abde6c46 Prepare battle log for spell-cast on server side. 2016-09-10 18:23:55 +03:00
AlexVinS
f8767a6380 cleanup 2016-09-10 09:37:18 +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
53502e84e3 Add PrepareHeroLevelUp netpack to keep secondary skills RNG in sync 2016-09-09 23:16:43 +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
c8bcb14d34 CCallbackBase: add CRandomGenerator to all callbacks
This is easiest way to make server RNG available to CBattleInfoCallback.

Now server, client and gamestate have own RNG instance.
Only server and gamestate RNGs are serialized.
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
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
Arseniy Shestakov
9296382bc6 More fixes for clang warning... 2016-09-08 19:58:01 +03:00