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

9319 Commits

Author SHA1 Message Date
84137dcaa5 Add DLL_LINKAGE to getStr and fix player id logging in VCAI 2016-09-16 05:45:00 +03:00
30042cac3d VCAI::performTypicalActions: always check that hero is still available
It's weird why this only appear now so if you have ideas check issue 2479.
2016-09-16 04:52:17 +03:00
c8090c78ec CGameState::updateRumor: fix infinite loop with only one map rumor 2016-09-15 23:22:25 +03:00
fdca75b4b0 PlayerColor: add getStr and getStrCap functions with optional L10n 2016-09-15 18:22:54 +03:00
ca0fe8fdc4 VCAI: do not attempt artefact and army exchange with ally hero
While visits of ally heroes supposedly occur accidentally It's still nice to handle it's gracefully.
No reason to prevent visits completely as they useful if hero have skill like Scholar.
2016-09-14 13:34:22 +03:00
7ec9601acd VCAI: safety checks to avoid crashes with boat objects
Probably we should rewrite boat-related code to make AI boat handling easier.
2016-09-14 03:44:35 +03:00
f623865991 CCastleBuildings: add dialog for shipyard when there is boat already 2016-09-14 03:32:03 +03:00
b5fa97b697 Merge pull request #211 from Chocimier/iss2321
Tested. Everthing looks fine so merging.
2016-09-14 00:37:17 +03:00
fedc4b7295 Merge pull request #213 from Chocimier/shrine
Check if hero knows spell even without wisdom
2016-09-14 00:09:11 +03:00
6dcb9a6068 VCAI: don't remove flagged objects from visitableObjs
This make my new shipyard-related changes work properly and might improve owned dwelling usage.
In case there still some code that might cause useless visits it's better just rewrite it insted of removing objects from visitableObjs.
2016-09-13 23:39:32 +03:00
c5e4eaf9c1 Check if hero knows spell even without wisdom 2016-09-13 22:28:21 +02:00
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
e1a1bc89c0 Extract PossibilityVisitor 2016-09-12 22:28:11 +02: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
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
33d1895d21 Merge branch 'develop' into SpellsRefactoring8 2016-09-11 18:34:18 +03:00
49e2bde3c0 Mostly complete fix for http://bugs.vcmi.eu/view.php?id=2429 2016-09-11 16:02:45 +03:00
9ab7650746 SetHeroesInTown: properly update all client interfaces in multiplayer
All interfaces that hero or town visible for must be updated when hero position in town changes. Fix issue 2089
2016-09-11 13:56:00 +03:00
3fa62beb6d Do not allow to cast Cure if there is nothing to cure. 2016-09-11 13:48:14 +03:00
fe6c0cf89b Use RandomGeneratorUtil::randomShuffle for reproducible gameplay 2016-09-11 00:10:52 +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
5e0a9d7966 hackfix for commander spells 2016-09-10 22:41:50 +03:00
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
40003460ca Check if building's dependencies are allowed 2016-09-10 19:38:49 +02:00
8eca149eb3 Fixed creature`s aimed spell targeting. 2016-09-10 20:21:51 +03:00
f36b40e311 fixed typo 2016-09-10 19:38:14 +03:00
b7509f588f Support all spell target types (except NO_TARGET) for creature casting. 2016-09-10 19:26:55 +03:00
be002f6576 Cleanup 2016-09-10 18:56:38 +03:00
62abde6c46 Prepare battle log for spell-cast on server side. 2016-09-10 18:23:55 +03:00
f8767a6380 cleanup 2016-09-10 09:37:18 +03:00
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
ea63497b19 Move CGameState::setupBattle code to CGameHandler::setupBattle
No reason to keep this code in GS.
2016-09-09 23:16:43 +03:00
53502e84e3 Add PrepareHeroLevelUp netpack to keep secondary skills RNG in sync 2016-09-09 23:16:43 +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
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
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
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
6747555339 CGameHandler: use ObjProperty enum instead of magic numbers 2016-09-09 17:42:16 +03:00
41abce102e Merge pull request #210 from Chocimier/display-fix
Fix choosing display
2016-09-09 07:24:35 +04:00
88ba42f91d Fix choosing display 2016-09-08 21:33:47 +02:00
9296382bc6 More fixes for clang warning... 2016-09-08 19:58:01 +03:00
02f70464fb Fix mismatched-tags Clang warnings
They're not important at all, but sicne there only few of them left just fix them.
2016-09-08 19:42:59 +03:00
d06d07a39b Add ChangeFormation netpack to avoid MP desyncs
Previous code was working fine for single client, but would cause desync in multiplayer. Fix issue 2460.
2016-09-08 19:29:15 +03:00
a109580b91 Use const for ObjectTemplate 2016-09-08 18:06:28 +03:00
114dac7e81 Added ObjectTemplate copy constructor and assignment operator 2016-09-08 17:02:59 +03:00
42e7128acc Fixed possible use-after-free crash with artifacts registration in RMG. 2016-09-08 14:48:48 +03:00
6dc47a2de0 Fixed use-after-free crash with quests registration in RMG.
* code taken from PR #200
2016-09-08 14:48:46 +03:00
78a560767b VCAI compareArtifacts: consider that art with highest price is best
That is suboptimal way as well, but let us avoid infinite loop there. Fix issue 2461
2016-09-08 04:29:27 +03:00
e16552c2c6 Merge branch 'PlayerStateFix' into develop
This is additional fix for old saves that were corrupt after PR #202 is fixed. Should probably make them all work properly.

Background: many years ago CBonusSystemNode didn't have proper serialization or at least PlayerState had some nissues with it.
Then bonus system was refactored many times, but that hack was forgotten or everyone just decide to not touch it.

Now it's end up this code wasn't needed probably for long time so we can finally remove it.
2016-09-07 18:18:23 +03:00