Arseniy Shestakov
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
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
8eca149eb3
Fixed creature`s aimed spell targeting.
2016-09-10 20:21:51 +03:00
AlexVinS
f36b40e311
fixed typo
2016-09-10 19:38:14 +03:00
AlexVinS
b7509f588f
Support all spell target types (except NO_TARGET) for creature casting.
2016-09-10 19:26:55 +03:00
AlexVinS
be002f6576
Cleanup
2016-09-10 18:56:38 +03: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
6747555339
CGameHandler: use ObjProperty enum instead of magic numbers
2016-09-09 17:42:16 +03:00
Alexander Shishkin
41abce102e
Merge pull request #210 from Chocimier/display-fix
...
Fix choosing display
2016-09-09 07:24:35 +04:00
Piotr Wójcik
88ba42f91d
Fix choosing display
2016-09-08 21:33:47 +02:00
Arseniy Shestakov
9296382bc6
More fixes for clang warning...
2016-09-08 19:58:01 +03:00
Arseniy Shestakov
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
Arseniy Shestakov
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
AlexVinS
a109580b91
Use const for ObjectTemplate
2016-09-08 18:06:28 +03:00
AlexVinS
114dac7e81
Added ObjectTemplate copy constructor and assignment operator
2016-09-08 17:02:59 +03:00
AlexVinS
42e7128acc
Fixed possible use-after-free crash with artifacts registration in RMG.
2016-09-08 14:48:48 +03:00
AlexVinS
6dc47a2de0
Fixed use-after-free crash with quests registration in RMG.
...
* code taken from PR #200
2016-09-08 14:48:46 +03:00
Arseniy Shestakov
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
Arseniy Shestakov
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
AlexVinS
f39e619304
More tweaks
2016-09-06 13:51:53 +03:00
AlexVinS
1ce4675df6
Tweaks
2016-09-06 13:33:11 +03:00
AlexVinS
838717dfc1
Magic mirror unified again with normal cast.
2016-09-06 13:05:33 +03:00
AlexVinS
686cd00c68
Cleanup.
2016-09-06 12:26:01 +03:00
AlexVinS
cc4362211c
Extracted MagicMirror handling
2016-09-06 11:03:36 +03:00
AlexVinS
f3d9e718bf
Handle AcidBreathDamage immunity in standard way.
2016-09-06 10:52:54 +03:00
AlexVinS
0241c6e843
Improved spell range calculation.
...
* should now support smart custom range AOE spells
2016-09-06 08:56:31 +03:00
AlexVinS
1e32c71e47
Make sure that there is no unwanted stack affect by spells.
2016-09-06 08:20:17 +03:00
AlexVinS
39c2c6cde7
Ensure no immunity to AcidBreathDamage
2016-09-06 07:16:32 +03:00
AlexVinS
f1d0bede11
Moved all affected stacks calculations to mechanics
2016-09-06 07:05:55 +03:00
AlexVinS
18fc94d709
WIP on SpellCastContext
2016-09-06 06:40:23 +03:00
AlexVinS
9ee954edcc
WIP on SpellCastContext
2016-09-06 05:11:32 +03:00
AlexVinS
1d840a33a5
Started SpellCastContext rework
2016-09-06 04:11:30 +03:00
AlexVinS
289cbbf2e7
Teach AI how to use massive timed effects.
2016-09-05 14:17:46 +03:00
AlexVinS
82ac035340
OO design for obstacle spells.
2016-09-05 13:34:48 +03:00
AlexVinS
f3b7fe947c
Reworked spell target existence check.
...
* related to 2269
2016-09-05 11:36:25 +03:00
AlexVinS
4cd264ef86
Merge branch 'develop' into SpellsRefactoring8
2016-09-05 05:22:50 +03:00