56345 Commits

Author SHA1 Message Date
happygrue
3265ad3b3f Rebalanced three THoT scenarios.
Tweaked starting gold and income for various sides.  Updated changelog,
players changelog.
2014-03-21 21:08:09 -04:00
Chris Beck
e6abd6d2c9 fixup bugfix 21758 (commit 186e66cec6519606bca5e07209c9a557c78b5e71) 2014-03-21 19:05:06 -04:00
lipk
eb48917ce5 Merge pull request #122 from Rift-Walker/config_edits
Config edits
2014-03-21 10:46:05 +01:00
Ignacio R. Morelle
d219881656 Improve a changelog entry 2014-03-21 01:16:32 -03:00
Ignacio R. Morelle
bbe8b7a816 Merge branch 'Add-unit-instance-recall-costs' of https://github.com/Aishiko/wesnoth into Aishiko-Add-unit-instance-recall-costs
Conflicts:
	changelog
2014-03-21 01:05:39 -03:00
Aishiko
2a923b5a26 Corrected use of cfg["foo"], removed 2 assignments, and 2 whitespace fixes
Changed from cfg["foo"] > number, to !cfg["foo"].blank(). Turned a cfg call into
just a default assignment.  Added a .to_int to a cfg["foo"] call to prepare
against bad user input.  Finally added whitespace to 2 lines to get them to line
up with the rest of the lines.
2014-03-20 23:25:16 -04:00
loonycyborg
d58589797b scons: relocate config.h and revision.h to build directory 2014-03-21 06:39:50 +04:00
8573
1c28c514a9 Add bit_width functions
Add the following functions in `src/util.hpp`:

    template<typename T> inline std::size_t bit_width();
    template<typename T> inline std::size_t bit_width(T x);

These functions compute the size, in bits, of a type or value, providing
a convenient and self-documenting name for the underlying expression,
`sizeof(…) * std::numeric_limits<unsigned char>::digits`.

This commit adds two additional header `#include` directives in
`src/util.hpp`. The newly included headers are as follows:

  - `<cstddef>`, for `std::size_t`; and
  - `<limits>`, for `std::numeric_limits`.

At first, I obtained the bit width of a byte using the C preprocessor
macro `CHAR_BIT`, defined in the C standard library header `<climits>`,
rather than using `std::numeric_limits<unsigned char>::digits`, but I
subsequently switched to using `std::numeric_limits` per Soliton’s
recommendation at 2014-03-17 21:36Z in the `#wesnoth-dev` IRC channel on
the freenode IRC network (<irc://chat.freenode.net/%23wesnoth-dev>).
2014-03-20 23:55:04 +00:00
Aishiko
b979516e75 Added Aishiko to about.cfg as requsted by shadowm
Added Aishiko and a comment about her being to blame for the unit instance
recall costs.
2014-03-20 19:42:23 -04:00
Aishiko
0fe4a943f3 Changed recall cost in recall dialog to default colour 2014-03-20 19:41:35 -04:00
Aishiko
c8346d3446 Added line to changelog for adding single unit instance recall costs 2014-03-20 17:58:12 -04:00
Aishiko
c288fcb203 Single unit instances work with whiteboard.
Here the changes to get whiteboard to work are mostly cosmetic, the
right cost for each unit is displayed on the unit in question.  This
is mostly for peace of mind as the user looks at the screen they don't
get confused.  The proper gold is also taken for each recall and
replaced for each canceled/undone recall while in whiteboard.
2014-03-20 17:57:31 -04:00
Mark de Wever
69b9b01dc4 Merge branch 'SDL_Texture'
Add a wrapper for the SDL_Texture. This contains the basics more
improvements will be added later.
2014-03-20 22:25:32 +01:00
Mark de Wever
ba447c16e6 Add texture creation code for the window.
Since textures are attached to a renderer the window (and thus its
renderer) often is the best place to create the texture.
2014-03-20 22:23:30 +01:00
Mark de Wever
e2ce7ec219 Add the initial SDL_Texture wrapper code. 2014-03-20 21:42:06 +01:00
Nathan Walker
923519d75a Change config assignment op to copy-and-swap
The previous implementation was not strongly exception safe.
This code is nearly identical logically, but with strong exception safety.
It's also good practice and more readable.
2014-03-19 22:28:49 -05:00
Nathan Walker
efec4735ed (cosmetic) fix code tabs
Codeblocks made some of my tabs into spaces and I had to fix it.
Also, forgot to mention this before, but I cleaned up some of the code
for astarsearch.cpp as well.
2014-03-19 22:16:56 -05:00
Nathan Walker
5eee20be97 clean up instances of std::copy
In many places, std::copy was used with back_inserters, or other
std::inserters. These have in most cases been replaced by using the
ranged insert member function of each stl container. Firstly, this makes more
readable code. Also, this is often more efficient because,
if the compiler can find the distance between the source iterators,
it only has to make one block allocation and then fill it
with values. In other cases, containers were being default constructed
and then std::copy'd into with some form of inserter. These were cleaned up
by using the iterator range constructor instead.
Use of std::copy was especially egregious in the case of associative
containers such as map and set. Sometimes back_inserter was
being used, other times std::inserter set at front, but it doesn't matter
because there is no front or back when inserting, and it's much cleaner
to just use set or map::insert(iterator begin, iterator end).
2014-03-19 21:23:27 -05:00
Chris Beck
60ee028417 Merge pull request #120 from cbeck88/purge_human_ai
Purge "human_ai" controller type
2014-03-19 17:22:01 -04:00
Chris Beck
60777429c3 Purge "human_ai" controller type
This is a fixup of bugfix #18829 (which was commit
736ceaa6c7e81882c9c5b2e932307b1f1ecb3bfd)
2014-03-19 17:20:36 -04:00
mattsc
64b41270e7 Messenger MAI: fix rare bug in attacks by messenger
This previously resulted in an error message when the messenger had
moves left but had no attacks left, a condition that was not checked
for.
2014-03-19 10:36:46 -07:00
Ignacio R. Morelle
eb07de2bc2 Fix for halos glitching through locations that become shrouded after rendering
Halos are never rendered for shrouded locations, but they are still
unrendered for them. A long-standing issue with [item] halos resulting
from this is that a halo that gets rendered to the screen at least once
for an unshrouded location later causes glitches if that location is
manually shrouded afterwards.

This can be avoided by not unrendering halos for shrouded locations. I
believe this solution makes sense because halos for shrouded locations
are never rendered first, and if the location is shrouded later on, the
display code will redraw the affected locations and overlay shroud on
top, causing the halo object's unrender buffer to become hopelessly
obsolete.
2014-03-19 00:06:26 -03:00
Chris Beck
e149b3f8d2 Revert "add debugging output to server"
This reverts commit f8a01890d119742ffc132771493489546f1c0052.
2014-03-18 18:56:57 -04:00
Chris Beck
342ba99030 Merge branch 'master' of https://github.com/wesnoth/wesnoth 2014-03-18 18:25:24 -04:00
Chris Beck
7708d06a93 workaround for bug #21797
at a certain point in playcampaign.cpp after the level has ended, wesnoth was
grabbing .child("end_level_data"), and writing carry_over sides.
this would cause "mandatory child missing" errors in the test case described.

we fix the error by checking if the child was not present and if so adding it.
however, it may indicate a more fundamental bug involving reloaded games.
2014-03-18 18:24:25 -04:00
Alexander van Gessel
1e154dd1f4 Merge branch 'master' of github.com:wesnoth/wesnoth 2014-03-18 08:18:47 +01:00
Ignacio R. Morelle
983f14663d Move unused script to utils/ 2014-03-18 03:05:10 -03:00
mattsc
e5ea7824d1 Patrol Micro AI: fix bug in the attack part of this MAI
This was an oversight dating back to the introduction of the [filter]
tag as a possible parameter to this Micro AI.  A part of the attack
code still relied on the id= key being given, although that key is not
required any more now.
2014-03-17 18:30:30 -07:00
Aishiko
1469c39f1c Single unit instances work with whiteboard.
Here the changes to get whiteboard to work are mostly cosmetic, the
right cost for each unit is displayed on the unit in question.  This
is mostly for peace of mind as the user looks at the screen they don't
get confused.  The proper gold is also taken for each recall and
replaced for each canceled/undone recall while in whiteboard.
2014-03-17 17:51:03 -04:00
Aishiko
d4896db78b Show unit instance recall cost in Recall dialog
Show in the recall dialog below the unit type the recall cost of
that unit.  The costs are also colour coded, red for more then the
team/side recall_cost, white for same as team recall_cost and
finally green for below team recall_cost.  It also alters the not
enough gold message from "you must have X gold to recall a unit." to
"you must have X gold to recall this unit."  There is some new
comparisions to make this all work.  The header for one function
(recall_dialog) has had a const of the team.recall_cost passed to it to
allow for the comparisions more easy to do in that function.

There is room for improvement here, perhaps removing the costs display
if no unit has a recall cost that differs from the others.
2014-03-17 17:50:31 -04:00
Aishiko
c6d11a5f5e Implement unit instance recall costs.
Actually allows for the unit instance recall costs to be used. Proper
taking of the gold and undoing the cost for each unit is implemented
and works.  At advancement if the unit's current recall matches their
unit_type's recall_cost then it takes the new unit_type's recall_cost
otherwise it keeps whatever value it currently has until it fails this
check.  Recall costs are also now persistant and will carry over from
one scenario into the next as well.

If a cost is not set, it will continue to use the team/side/default
costs, these changes should not affect the current workings when
dealing with unaltered scenarios, and unit config files.  I repeat This
will not affect or change the currently way things work UNLESS a user
alters a file or includes the new recall_cost (as in copies and
modifies a unit in the scenario unit files) for a unit instance in
their scenario file(s).
2014-03-17 17:49:15 -04:00
soliton-
8e9fcd1704 Merge pull request #118 from aquileia/new-branch
minor fixes
2014-03-17 22:29:14 +01:00
Alexander van Gessel
f2bdee1a80 Remove unused ucs2_string. If we want a utf16 type, it should be named for that 2014-03-17 13:44:02 +01:00
Chris Beck
cb6033ceb3 Merge branch 'server_set_to_idle' 2014-03-17 07:59:13 -04:00
Chris Beck
ad4c57f22e implement "last 5 chats" notification properly
(fixup 6d460b98271312f806fadfa037b7ea082e862a24)

proper code to find 5'th \n is:

		int endl_pos = -1;
		for (int ctr = 0; ctr < 5; ctr++)
			endl_pos = i->message.find('\n', endl_pos+1);

and not

		int endl_pos = 0;
		for (int ctr = 0; ctr < 5; ctr++)
			endl_pos = i->message.find('\n', endl_pos);
2014-03-17 07:50:02 -04:00
Chris Beck
f8a01890d1 add debugging output to server 2014-03-17 07:50:01 -04:00
Chris Beck
2430b491df don't show network_ai controllers in :give_control dialog 2014-03-17 07:50:01 -04:00
Chris Beck
b854aab437 don't display network_ai sides as replacements for dropped sides
after 18829 fix, don't display "network_ai" sides as possible
controllers for a dropped side, as all ai sides now have this value.
2014-03-17 07:50:01 -04:00
Chris Beck
736ceaa6c7 fix bug #18829
it turns out that when the "network_ai" controller type was introduced,
it was implemented on the server in the following way:

a4f47a63c7/src/server/game.cpp (L464)

change_controller requests to the type "ai" are always transformed
by the server into either "human_ai" for host or "network_ai" for client,
and in thunderstruck's refactor of the mp_connect dialogs, ai sides are
always set to "ai" in the WML sent to the server (and set this way on
the host).

however, because of code in play_campaign.cpp which long predated this
refactor, all sides on an mp client are either set to human (if that
player controls them) or "network", or "null".

this causes problems because if that player saves the game, the savegame
will record these sides at human controlled rather than ai controlled...
if the game is reloaded oos can occur, although I won't detail it here.

we update the play_campaign.cpp code to ensure that "ai" controller types
always resolve to human_ai or network_ai as appropriate. additionally,
we make sure that on the host, sides always resolve to human_ai rather
than ai. so the type "ai" should never be observed during an mp game,
and only during scenario configuration, and perhaps during replays.

additionally, we ensure in playturn.cpp that if the client gets a message
from the server to set a side to "ai" during the game, it will in fact
set it to "human_ai" or "network_ai", to preserve the invariant.

finally we also switch over observers to follow this behavior --
previously there was a hack here in the server which would make sure
that any observers which join see all sides as controlled by "human"

a4f47a63c7/src/server/game.cpp (L197)

in order that they do not attempt to substitute themselves for a player.

we change this by removing the hack, and programming the client to remember
if the player is an observer, and if so not attempting to substitute themself
at game start.
2014-03-17 07:50:00 -04:00
Chris Beck
886c2390d8 fixup party full bell
after fix of bug #21578, the behavior from 1.10, in which game may not
start until all sides have chosen factions as needed, was restored.
we move the party full bell appropriately.
2014-03-17 07:50:00 -04:00
Chris Beck
186e66cec6 fix bug #21758
in the refactor of mp_connect, one behavior from 1.10 that was
lost was that the host may not start a game until all sides have
chosen faction. we restore this, adding fields to the side engine
to fix in a robust manner, some debugging capabilities left over.
2014-03-17 07:42:58 -04:00
David Mikos
fcaf8b3fc7 Merge branch 'master' of github.com:wesnoth/wesnoth-old 2014-03-17 07:51:03 +10:30
David Mikos
19c78e87b4 Chill tempest animation for lich/ancient lich. 2014-03-17 07:48:02 +10:30
Chris Beck
420f9e8069 recognize server messages to set a side to idle 2014-03-16 15:38:17 -04:00
Nils Kneuper
78df2160d6 updated Scottish Gaelic translation 2014-03-16 09:04:17 +01:00
Chris Beck
ce06371a99 Merge branch 'master' of https://github.com/wesnoth/wesnoth 2014-03-16 03:11:42 -04:00
Chris Beck
db153ed19c blindfold_enabled => skip_replay enabled, in playmp_controller
this was suggested by Wintermute, as it is hard to see why you
wouldn't want the replays to go fast if you can't see anything.
2014-03-16 03:09:48 -04:00
Chris Beck
af383e8ebb workaround for bug #21797
when the side engine in multiplayer_connect_engine.cpp loads a side,
if the game is a save game, the side is not allowed to have a human
player, and it is listed as "network", then we set it to ai,
assuming that it "should" be a "network_ai" if bug #18829 is ever
fixed
2014-03-16 03:06:52 -04:00
David Mikos
f5323b627c Khalifate melee attack sound timings fix. 2014-03-16 15:07:48 +10:30
anonymissimus
e45894c17b vc project update 2014-03-15 20:53:33 +01:00