56148 Commits

Author SHA1 Message Date
mattsc
c72c8e7ff2 Messenger MAI: add optional invert_order= key
In the default configuration, the AI moves the messenger which has
advanced the furthest through the waypoints first.  If this key is set,
the rearmost messenger is moved first.
2014-03-27 14:36:32 -07:00
mattsc
62f709aaa3 Messenger MAI: allow several messengers to be controlled by AI
For two of the CAs this mostly just means reading the [filter] tag and
picking one of the messengers.  However, for the CA moving the escort
units, it means a complete rewrite, as the AI now needs to figure out
which escort unit should be moved toward which messenger.
2014-03-27 13:36:29 -07:00
mattsc
2d458b642a Messenger MAI: fix bug with escort units blocking the messenger
When there were lots of escort units, they previously quite frequently
blocked the messenger’s way, preventing him from making progress even
when it was possible.  Escort units now specifically move out of the
way if they do not need to attack enemy units in the messenger’s way.
2014-03-26 18:06:36 -07:00
mattsc
9e6b780306 ai_helper.get_closest_location(): fix bug with tags in SLF
The way how the Standard Location Filter was dealt with only worked
with keys, not tags.
2014-03-26 18:03:50 -07:00
Chris Beck
15a4c1f74c apply a brief blindfold when changing sides in hotseat mp
Fix bug #3865: While the turn dialog used for changing sides is active,
apply a blindfold, which is removed when the dialog is cleared.
2014-03-26 01:04:50 -04:00
Chris Beck
56bdb6aa05 blindfold is removed when control of a side is received
in blindfold_ii, blindfold was taken off when local side takes control
in this fixup, blindfold is taken off as soon as host gives control of
any side.
to achieve this, playturn.cpp must be able to ask the playcontroller to
remove the blindfold.
we create a virtual method of play_controller, on_not_observer,
which is called whenever this client gets local control of a side
(it becomes ai or human)
on all play_controllers except play_mpcontroller, this does nothing
in play_mpcontroller it calls a "remove_blindfold" function
when a human side takes control, remove_blindfold is still called,
as a precaution.
2014-03-26 00:35:55 -04:00
mattsc
f417faa2d5 Move path to Micro AI candidate actions files into variable
The purpose of this commit (and the previous) is to make it easier for
UMC authors to add functionality to the Micro AIs.
2014-03-25 08:09:49 -07:00
mattsc
5df117161a Move Micro AI auxiliary functions into their own file 2014-03-25 07:59:29 -07:00
mattsc
76bcdae73c Messenger MAI: add optional [filter_second] tag
This allows selection of the escort units.
2014-03-25 06:32:58 -07:00
mattsc
bfa48aa52b Update Xcode project 2014-03-25 06:16:59 -07:00
Alexander van Gessel
3113763de0 Revert XCode changes in "Attempt to update projectfiles"
This reverts part of commit f786c2d4229ea16f6d6fbe24f557a524af74707d.
2014-03-24 22:02:35 +01:00
Mark de Wever
4b298611fb Merge branch 'SDL2_exception'
Improves the exception handling for the SDL2 code.
2014-03-24 20:01:06 +01:00
Alexander van Gessel
d79b7d6547 Merge branch 'master' of github.com:wesnoth/wesnoth 2014-03-24 04:31:39 +01:00
Alexander van Gessel
1c73372beb Add missing include for windows-only files 2014-03-24 04:25:18 +01:00
Alexander van Gessel
89e1eba6df Merge pull request #130 from Aishiko/Add-unit-instance-recall-costs
Correct gold check comparision in recall dialog
2014-03-24 03:22:02 +01:00
Aishiko
5beed0a0f5 Correct gold check comparision in recall cost
By correcting the assignment of the cost of the unit it now correctly
says whether or not the play actually has the gold to recall a unit, as
after this check it is assumed they do by the program which creates
the possibility of recalling when you have no gold, or negative gold.

Added comments so that the magic number is explained.
2014-03-23 21:51:59 -04:00
Alexander van Gessel
e132df7d64 Remove gitignore in otherwise empty dir 2014-03-24 00:32:39 +01:00
Alexander van Gessel
f786c2d422 Attempt to update projectfiles 2014-03-24 00:32:15 +01:00
Alexander van Gessel
c192854e32 Whitespace fix 2014-03-24 00:25:01 +01:00
Alexander van Gessel
1b2bfa1e2a Include system headers with <>, not "" 2014-03-24 00:24:50 +01:00
Alexander van Gessel
1aad7f9d45 Move unicode support to its own file 2014-03-24 00:24:21 +01:00
Alexander van Gessel
7df83c22a8 Don't dereference iterator after invalidating it
Found by coverity.
2014-03-23 19:31:40 +01:00
Alexander van Gessel
ae34792417 Initialize all members
Found by coverity.
2014-03-23 19:22:03 +01:00
Nils Kneuper
4e514f2304 updated German translation 2014-03-23 18:02:04 +01:00
Alexander van Gessel
b6d4b9c71a Changelog entry for unicode handling improvements 2014-03-23 17:20:14 +01:00
Alexander van Gessel
436582337c Fix an identifier. Spotted by aquileia 2014-03-23 14:44:07 +01:00
Mark de Wever
f1793ab3e8 Use the new SDL exception in the SDL code.
Also:
* Fix a copy paste error in an error message.
* Make creation failures of a texture object throwing an exception.
2014-03-23 13:22:07 +01:00
Mark de Wever
982a844470 Catch the new SDL exception in the main game. 2014-03-23 13:17:29 +01:00
Alexander van Gessel
4e50c064e3 Merge branch 'master' of github.com:wesnoth/wesnoth 2014-03-23 13:13:44 +01:00
Alexander van Gessel
883fe46cad Use existing named constants 2014-03-23 13:13:19 +01:00
Alexander van Gessel
5b72299c39 Match declaration with definition 2014-03-23 13:13:08 +01:00
Mark de Wever
f6b52f338c Add the SDL exception class. 2014-03-23 13:09:08 +01:00
David Mikos
c770104621 Fix bug #21257: make skip AI mid-movement animations invisible and only enable at end. 2014-03-23 18:08:10 +10:30
Alexander van Gessel
6b5f357b6e Follow up the utf8 namespace with ucs4 and utf16 namespaces 2014-03-23 04:24:02 +01:00
Alexander van Gessel
a25a0b7d35 Reshuffle some tests 2014-03-23 03:48:04 +01:00
Alexander van Gessel
b0d31d07e3 Merge branch 'wide_string_elimination'
Conflicts:
	src/dialogs.cpp
	src/gui/dialogs/addon_list.cpp
	src/gui/widgets/password_box.cpp
	src/gui/widgets/text.cpp
	src/gui/widgets/text_box.cpp
	src/marked-up_text.cpp
	src/serialization/string_utils.cpp
	src/serialization/string_utils.hpp
	src/text.cpp
2014-03-23 03:46:01 +01:00
Alexander van Gessel
1f4fe17576 Add some unicode handling tests 2014-03-23 02:59:00 +01:00
Alexander van Gessel
9d2465fb20 Prevent some possible buffer overflows 2014-03-23 02:22:52 +01:00
Alexander van Gessel
6318b37ffd Get rid of utils::wide_string
utils::wide_string was a std::vector<wchar_t>
On most unix systems, this is 32 bits wide, and therefore a UCS-4 encoding.
On windows however, wchar_t is 16 bits wide, and the naive approach results
in UCS-2, which can only represent the Basic Multilingual Plane.

Most functions that used wide_string have been moved over to ucs4_string.
The Win32 API has been moved over to a specially created utf16_string instead.

Specialty tolower #ifdefs have been removed, as the towlower function has
been available since OS X 10.3, OpenBSD 3.7 and probably ancient versions of
all other BSDs too. The only issue is that on windows, the function cannot
be applied to characters outside the BMP.
2014-03-23 01:56:40 +01:00
Alexander van Gessel
8386c592e7 Merge pull request #126 from aquileia/utf8
Improve UTF-8 handling
2014-03-23 01:10:14 +01:00
aquileia
246f599bd0 fix signature and test for UTF-8 functions
On the advise of 8680, the unicode string was replaced by the hex
transcription of the corresponding codepoints (which he kindly
provided).
This might help to pass the overzealous encoding check of clang.

This commit also fixes a discrepancy between the signature of u8index in
declaration and definition.
2014-03-23 00:08:27 +01:00
aquileia
2f6a6a7d0e move UTF-8 functions to a separate namespace 2014-03-22 20:57:01 +01:00
aquileia
9351a25249 Fix a wrongly passed parameter in text_box.cpp 2014-03-22 20:55:58 +01:00
Ignacio R. Morelle
e96bd0f1e1 Sort players changelog categories by alphabetical order 2014-03-22 15:39:27 -03:00
aquileia
52c80db79e Improve UTF-8 handling
For manipulation of UTF-8 encoded strings (insert, delete, truncate, and
size), usually conversion to wstring and back was necessary. This has
two disadvantages:
* the size of wstring is implementation defined
* the
double conversion is slow

The purpose of this patch is to add functions
to handle these tasks by a layer handling the different indexing between
codepoints and characters.

This commit applies these functions in
several places to replace the old implementations.

The byte_size_from_utf8_first() implementation will be replaced in a
separate commit as it relies on the count_leading_ones function by 8680.

Signed-off-by: aquileia <sk.aquileia@gmail.com>
2014-03-22 15:39:23 +01:00
aquileia
c928358106 Extend .gitignore for VC project files
This commit adapts .gitignore to the new MSVC compilation
recommandations on the wiki.

Signed-off-by: aquileia <sk.aquileia@gmail.com>
2014-03-22 15:39:01 +01:00
aquileia
d55848319d fix password box documetation
Signed-off-by: aquileia <sk.aquileia@gmail.com>
2014-03-22 15:38:37 +01:00
loonycyborg
7116ccf9ef scons: Made out-of-tree builds with -Y option work 2014-03-22 17:45:21 +04:00
Andrius Silinskas
fa5b916bf1 Add missing MP settings for reloaded games. Fixes #21808.
The problam was that mp::configure is not used for reloaded games and so
mp_game_settings will not be fully initialised. This leads to using default
values rather than values set using mp::configure screen or from reloaded game
config.

The optimal solution would be to either display mp::configure for reloaded games
or to populate mp_game_settings using reloaded game config. However, both
solutions require rather a lot of code restructing and are probably not suitable
for a feature freeze.
2014-03-22 12:51:05 +00:00
Nils Kneuper
80feaee818 updated German translation 2014-03-22 09:29:46 +01:00