71312 Commits

Author SHA1 Message Date
gfgtdf
a32f6aaf64 make sure units are always stored in unit_ptr step2
previously the unit ctor could invoke arbitrary umc lua code, for
example via advance_to -> add_modification ->
resources::lua_kernel->apply_effect and during that call the unit was
not owned by a unit_ptr, so the code could not use unit_ptr objects at
several places because the unit might not be owned by a unit_ptr object.
2018-03-11 01:36:16 -05:00
gfgtdf
b2cb4be47d Fix #2615
this changes it so that the during events the attack_type references its
context units always by location, like it was done in 1.12, considering
the soon 1.14 release i think this is the best fix

The problem with the old implementation basically was that if a wml
script replaced the unit in a attack events  the
attack_type::self_/other_ would point to an outdated unit during the
next handler of the same event.
2018-03-11 01:35:37 -05:00
Charles Dang
7ed2e57ebc Fixup 950a156 (revert unintended changes) 2018-03-11 15:26:38 +11:00
Charles Dang
950a156712 Addressed most of the remaining whitespace issues from #2613
[ci skip]
2018-03-11 14:59:37 +11:00
Charles Dang
5fc4dcf5fa Revert "Message Dialog: make all option rows have the same height"
[ci skip]

This reverts commit 0089357edb0c3900c5645a138520391bb0f09626. It wasn't suitable for
all usecases, and it's impossible to make it a dialog option.

Fixes #2628
2018-03-11 14:02:16 +11:00
Jyrki Vesterinen
7637a36c3f Assert that there are no disabled event handlers when saving
If there are still issues with this, it's better for the game to
complain about the problem loudly than sweep it under the carpet.
2018-03-10 17:24:49 +02:00
Jyrki Vesterinen
857f5a9e71 Use a RAII class to block game event handler cleanup
This ensures that throwing an exception through
game_events::manager::execute_on_events() won't corrupt the stack frame
counter and disable event handler cleanup forever.

I also added a safety check in case there are some kind of ephemeral
event handlers which run a nested game loop and never return. Saving in
such a state wouldn't be safe.
2018-03-10 17:19:54 +02:00
Jyrki Vesterinen
97183e37c8 Revert "Mark game_events::manager::execute_on_events() as noexcept"
This reverts commit 45cab78cfb67441dff36826162e36c980a72a222.

Further testing indicates that exceptions can indeed pass through the
function, and therefore marking it as noexcept isn't safe.
2018-03-10 16:25:43 +02:00
Jyrki Vesterinen
45cab78cfb Mark game_events::manager::execute_on_events() as noexcept
The function relies on never throwing exceptions in order for cleanup of
disabled events to work. Best to enforce that requirement.
2018-03-10 11:49:41 +02:00
Lari Nieminen
b6fa4740f3
SoF S7: Fixed the castle moveto event terrain filter
[ci skip]
2018-03-10 11:10:32 +02:00
Gregory A Lundberg
1c745befa8
Fix doccomment. 2018-03-09 23:24:15 -06:00
Iris Morelle
8442764435 Add script for creating a new campaignd instance
[ci skip]
2018-03-10 01:08:58 -03:00
sigurdfdragon
40119cc0f6 [WIP] NR S13a & S14a: Appearance improvements
Don't show carryover report after final battle.
Make orcish fortress look like an orcish fortress.
Fix trees being added when player can see it.
Continue to credits at end of dialog in S14a.
2018-03-09 19:41:54 -05:00
Nobun
11d48f1639 help text fixes (#2617) 2018-03-09 20:31:05 +01:00
gfgtdf
9e8220022a don't generate [side]s if the [multiplayer] has at least one [side] defined.
fixes one part of #2604
2018-03-09 20:46:36 +02:00
Charles Dang
471c9e876a Addressed a large chunk of the whitespace issues from #2613
[ci skip]
2018-03-09 11:37:00 +11:00
Charles Dang
0cb9f0d622 Data/Test: wmlindent run
[ci skip]

Addresses some of the whitespace issues mentioned in #2613
2018-03-09 11:22:00 +11:00
Charles Dang
33725add8f Data/AI: wmlindent run
[ci skip]

Addresses some of the whitespace issues noted in #2613.
2018-03-09 11:07:23 +11:00
Charles Dang
23a180b145 Preferences Dialog: don't use invalid initial selection for combo advanced prefs
Fixes #2612. Bug above was caused with a legacy value for compress_saves ("no") in the user's
preferences file. Since that didn't match an option ID, the game passed an invalid value to
menu_button::set_values, which then asserted. It's not really worth it to add value aliases to
handle the legacy compression values, so we just reset the initial selection to 0 if an invalid
(in this case, one of the legacy values) is used. Might mean some user's preferences get
inadvertently reset,but they can simply update their selections again. At least it's not crashing.
2018-03-09 10:57:13 +11:00
Charles Dang
13f9a9b18e Addons: add .ini files to the list of default-excluded types 2018-03-09 03:24:38 +11:00
Gregory A Lundberg
b3b3b61c5a
Remove trailing tabs from CodeBlocks projectfile 2018-03-08 07:40:43 -06:00
pentarctagon
02244aaa53 Make LTO controlled by a variable export in steps/install.sh.
Currently will remain disabled everywhere, but this allows for enabling LTO for optimized, non-xcode jobs just by changing the value of the LTO variable.
2018-03-08 15:40:05 +02:00
pentarctagon
ee51afa128 Moves the build-cache directory to be under $HOME.
Moving it out of the same directory as the git repository means that the object files won't be copied into the temporary docker container when it's being created.
2018-03-08 15:40:05 +02:00
pentarctagon
258b8b9bae Make docker_run.sh use 4 space indenting to match other shell scripts.
Also split apart the really long scons/cmake single lines
2018-03-08 15:40:05 +02:00
newfrenchy83
5e272829fa Update wesnoth.cbp 2018-03-08 06:31:29 -06:00
sigurdfdragon
e3c5726114 Update changelogs
[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
9f5a61601a NR S12a & 13a: Improve handling of Sisal & the Liches
Make Sisal loyal at end of S12a.
Have Sisal & the Liches appear in S13a at a time that makes more sense.

[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
c243ca5c7b NR: Clean up handling of flags for secondary player sides
Drakes get long, elves get wood-elvish, and liches get undead.

[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
77f8565553 NR S13a: Ensure correct unit type and facing for opening animations
Only needed type fix for Krash, Eryssa, & Tallin, but did them all.

[ci skip]

Add facing for entrance - merge with other commit
2018-03-07 19:51:56 -05:00
sigurdfdragon
a53ce26d3f NR S13a: Clean up side 9 handling to match previous commit
[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
673e33bb20 NR: Fix Krash resurrection bug
After changes in 618659c083b6, the leader keys in Krash's side caused him
to be reborn if he was killed in the previous scenario for S11a-S13a.

[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
35d32a0a80 NR: Ensure secondary player sides have names in statistics and carryover
[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
86fc31d2ef NR S13a: Add income & loyal so Rakshas's side is more intimidating
Bump his income since he doesn't start with any villages.
Make guards loyal so they don't drain starting gold too quickly.

[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
99ba7af231 NR: Fix and use character macro for Rakshas appearances
Unifies handling of character and ensures correct portrait is used.
Fixes part of issue #2569

[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
884af3b016 NR S09a: Move troll out of likely vision of the player's ghost at start
There is dialog for when the player first sees a troll.

[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
018b033266 NR S04: Make objectives more accurate
[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
fe667e8416 NR S10a & 11a: Fix carryover & bump gold to compensate
So all carryover options are the same.
Also reposition gold macro to match one added.

[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
b0ae6aa1b1 NR S11a & 13a: Make the orcish fortresses look like orcish fortresses
[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
a1f7232ca7 NR S09a: Have Supporter speak to ensure that it's not Tallin
Otherwise it looks odd when Tallin says this and the follow-up line.

[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
7bf48ccf23 NR 07a: Properly store the gold for later and give intended starting gold
Otherwise, gold is not stored to be recovered for S13a and player is given
100 gold for starting S07a no matter the difficulty.

[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
0ee72d9bf9 NR S12a: Use valid side number so units end up on the recall list
With the bug out of the way the rest of the code for the scenario
runs properly, so this fixes parts 3 & 4 of issue #2569

[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
e982bf7ef5 NR S07a: Fixes for closing dialog
Leave Ro'Arthian on the board and have the cage removed & Ro'Sothian
positioned properly.

[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
7686e53fdc NR S06a: Cleanup type change for Tallin
Simplify & if he has the rod, he will start with the correct move count.

[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
f3348dc485 NR S06a: Set cave area to UNDERGROUND time
[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
056b930d4a NR S06a: Fix & improve gold carryover
Have objectives match endlevel.
Bump carryover so a more impressive amount is stored next scenario.

On my easy level playthrough I only had 680 carryover. This
change makes it be around 1700 instead.

[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
2866f58414 NR S05a_01: Make enemy gold add events work properly
Use LOYAL_UNIT macro & adding a side for monsters so the enemy sides
don't go to negative gold before the events are triggered.

[ci skip]
2018-03-07 19:51:56 -05:00
sigurdfdragon
f7aa961f00 NR S04: Use LOYAL_UNIT macro so placed units don't affect starting gold
[ci skip]
2018-03-07 19:51:56 -05:00
Jyrki Vesterinen
494b2f35ca Fix #2608: possible crash after Monte Carlo simulation for slowed unit
Due to rounding error, if the unit was already slowed, it was possible for
the code that calculates the probability to be slowed to arrive at a bit
above 100%. If the AI later simulated another fight for the same unit, it
triggered the assertion that the probability wasn't in allowed range.

Fixed by limiting the probability to 100%.
2018-03-07 22:16:37 +02:00
Sofartin
07436dd7bd Add missing scenario-story.cfg in data 2018-03-07 13:59:52 -06:00
gfgtdf
c64c6f513a
fix no_leader having no effect (#2606)
fix no_leader having no effect

fixes #2604

it previously only worked if both leader_lock and no_leader were set to yes. Now it the type= is preserved if any of the two are given, the difference bewteen those two is that no_leader only works is type= is empty. 

this also fixes some wrong parameternames in the the flg_manager ctor declaration.

This commit does not change the default value for those keys: no_leader default to yes in [side]s in [scenario] but not in multiplayer. While leader_lock defaults to the force_lock_settings key in [scenario]/[multiuplayer]
2018-03-07 12:35:27 +01:00