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
DjWarmonger
f686e4fe80
Merge branch 'develop' of https://github.com/vcmi/vcmi into develop
2016-08-30 08:05:30 +02:00
DjWarmonger
6791350975
Compile fix (operator = is ambiguous).
2016-08-30 07:50:38 +02:00
AlexVinS
7e0c4e1451
tweak
2016-08-30 08:27:01 +03:00
Arseniy Shestakov
0236309d25
CArtifactsOfHero: use shared_ptr for SCommonPart
2016-08-30 07:05:31 +03:00
AlexVinS
b8f4fdc2f2
fixed memory leak in CTradeWindow::initItems
2016-08-30 05:55:51 +03:00
AlexVinS
e2e5bc4920
fixed fadeAnims memory leak
2016-08-30 05:46:25 +03:00
AlexVinS
f0b3a13ed5
Fixed memory leak in CCreatureAnimation
2016-08-30 05:38:56 +03:00
AlexVinS
ef05a56e49
cleanup
2016-08-30 05:13:45 +03:00
AlexVinS
1c9dd41188
Removed unused STOP_CLIENT SDL event
2016-08-30 03:54:46 +03:00
AlexVinS
4bc27194dd
do not leak screen surface etc. on quit
2016-08-30 03:43:49 +03:00
AlexVinS
2018b4d406
Rewritten video mode check.
...
* check only for current desktop display mode, because we are not using actual fullscreen
* also old check was wrong
2016-08-30 03:27:53 +03:00
AlexVinS
fb7ff8c7fa
Do not use std::atexit. Modified patch from PR #204 by @krnowak.
...
std::atexit generally does not play nice with static objects in other
translation units/libraries - there are no guarantees about the order
of destruction of static objects and atexit functions coming from
different translation units/libraries. Removing calls to atexit fixes
crashes when quitting the game. The crash happened during the dispose
function somewhere inside boost's locale library that is used
indirectly by the logger - some locale function tried to lock a static
mutex that was already destroyed.
2016-08-30 01:26:05 +03:00