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

5955 Commits

Author SHA1 Message Date
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
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
49e2bde3c0 Mostly complete fix for http://bugs.vcmi.eu/view.php?id=2429 2016-09-11 16:02:45 +03:00
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
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
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
13aedac3f4 Fixed war machines spell immunity.
* Should fix http://bugs.vcmi.eu/view.php?id=2407
2016-09-05 05:21:13 +03:00
Arseniy Shestakov
8e94b1c4d2 VCAI::objectRemoved: handle hero boat removal. Fix issue 2350
Avoid situation when AI attempt to visit boat after it's killed hero who used it.
2016-09-04 15:44:42 +03:00
Alexander Shishkin
11a1cf0493 Merge pull request #208 from Mixaill/travis
update travis.yml
2016-09-04 16:11:30 +04:00
DjWarmonger
6122186efa Removed old template duplicated by new package. 2016-09-04 13:31:04 +02:00
DjWarmonger
d2bd749b4f MSVS project fixes. 2016-09-04 13:30:11 +02:00
Mikhail Paulyshka
9cf7596344 update travis.yml 2016-09-04 13:49:03 +03:00
AlexVinS
22f729a3fe CPlayerState serialize fix. 2016-09-04 13:43:09 +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
ArseniyShestakov
5fc1fd4daf Merge pull request #206 from Chocimier/fixes
genBuildingRequirements is tricky one, but in tests it's seems everything is okay
2016-09-04 09:02:34 +03:00
AlexVinS
ad3049e6f8 Merge branch 'krnowak/choose-display' into develop 2016-09-04 04:06:42 +03:00
Arseniy Shestakov
076924166a CPlayerInterface: always choose hero if there no town. Fix issue 2073 2016-09-01 07:08:37 +03:00
Alexander Shishkin
ce669c8a0a Merge pull request #207 from krnowak/krnowak/leak-fix
Fix memory leak
2016-08-31 15:58:26 +04:00
Krzesimir Nowak
46bd1c40cc Fix memory leak
SDL_RWFromMem does not take the ownership of the passed memory, so we
have to free it ourselves.
2016-08-31 11:45:37 +02:00
Krzesimir Nowak
58bc0f7272 Allow choosing the display from the launcher
This adds another combobox for choosing the display. To ease the
display choice we try to roughly describe the display (its resolution
and location).

The combobox is hidden for single display setups.
2016-08-31 11:12:59 +02:00
Krzesimir Nowak
12f2006fbf Show the game window on the configured display
This basically starts respecting the displayIndex setting. When
changing the fullscreen setting in-game, we read the display index
from the already existing window.
2016-08-31 11:12:59 +02:00
Krzesimir Nowak
32f5033a4d Add a displayIndex setting to the video settings
This setting will control on which display the game window will be
shown.
2016-08-31 11:12:59 +02:00
AlexVinS
437eadf1ed do not leak scenarioOpts in CMapInfo 2016-08-31 06:18:01 +03:00
Piotr Wójcik
a4f12fb007 Show downloaded mods with no need to reload remote repositories 2016-08-30 22:16:52 +02:00
Piotr Wójcik
044e2b9e51 Properly calculate building requirements
In OH3 you can't build Capitol when Tavern is not builded.
In VCMI up to now you could.
2016-08-30 22:15:24 +02:00
Piotr Wójcik
326be61ecb Show atrifact's name in message of Warrior's tomb 2016-08-30 20:50:03 +02:00
Piotr Wójcik
52797082aa Do not show whether Shrine is visited by hero, if was not visited by player yet 2016-08-30 20:48:03 +02:00
AlexVinS
cf1d5d0bc9 tweaks 2016-08-30 11:45:05 +03:00
AlexVinS
a50a32405d Use weak_ptr for TypeDescriptor cross-links. Fixed total TypeDescriptor memory leak. 2016-08-30 09:48:12 +03:00
AlexVinS
c6d257f328 Fixed CQuest leak 2016-08-30 09:48:10 +03:00