56345 Commits

Author SHA1 Message Date
Elvish_Hunter
082992beed Removed sanity checks for missing variable=, [case] and value= in [switch] 2014-04-12 10:15:28 +02:00
Elvish_Hunter
c35e08dbfd Removed sanity check for missing [do] in [while] 2014-04-12 10:15:28 +02:00
Chris Beck
84722f567d fixup server controller tweaks
server was not properly handling empty sides in the initial level
thanks to gfgtdf for tracking this down and spotting the coding
mistake.
2014-04-12 01:21:36 -04:00
gfgtdf
0cda27dd2d disable RESET_REPLAY during actions
this caused assertion errors.
2014-04-12 02:37:54 +02:00
mattsc
122a1c852f Update Xcode project 2014-04-11 17:26:59 -07:00
mattsc
bb8c08a314 Micro AIs: standardize eval/exec function table setup 2014-04-11 17:21:58 -07:00
David Mikos
59e95ff304 Add 'elemental' trait to mudcrawler line. 2014-04-12 09:33:25 +09:30
gfgtdf
627c5a9c5c use const config& for value check
the intention is to remove the annoying 
async=""
dependent=""
undo=""
in replays.
2014-04-12 00:33:42 +02:00
gfgtdf
f6fbfb6879 Merge pull request #141 from gfgtdf/sync_fix
fixes bugs intrduced in pr 121 and more
2014-04-11 23:53:27 +02:00
Bär Halberkamp
70322185d4 Restored lightred and darkred TC 2014-04-11 23:46:11 +02:00
gfgtdf
9017fe82da fix 21905
we have one events_disabler when starting the replay_controller and a
second when entering the synced context. Thats why we have
events::commands_disabled == 1 and >1 when we are executing an action.
2014-04-11 23:05:43 +02:00
gfgtdf
4765b33f58 add side parameter in sync_choice
when we call sync_choice with a third argument there was no way to
determine for which side we actualy made the decision.
2014-04-11 23:05:32 +02:00
gfgtdf
c9552c9a33 allow user_choice in prestart for invisible choices 2014-04-11 23:05:20 +02:00
gfgtdf
e1a5bb89dc disable get_user_choice during prestart events
get_user_choice usually shows a dialog to the user. Because we shouldn't
use the screen during prestart events i disabled it there.

this commit might contain spelling corrections.
2014-04-11 23:05:09 +02:00
gfgtdf
847067dac7 fix bug chat during action
when a player chats while multiple actions from another player are
executed on the local machine we before got an assertion error becasue
replay s add_command expects that there are no other commands yet to be
processed on the replay.
(this was broken at da4cdef146bf5a1b8026f12d6b1caa6c1cd20602)
we now fix this problem by ensuring that there is never more data on the
replay than needed.

for this purpose i wrote that playturn_network_adapter.cpp whose main
purpose it to split incoming [turn]s into smaller [turn]s
we also don't need the backlog anymore because now with playturn_network_adapter we only feed process_network_data with small data pieces that can always be handled at once.

I also removed the replay_ member of turn_info.
Before, we read actions from replay_srouce and wrote actions to recorder.
And after the actions in replay_source has been executed they had been pushed into recorder.
With get_user_choice this doesn't work, because we might end up pushing the 'answer' (the user choice) of a get_user_choice in the recorder while the 'question' (the invoking user action) was in replay_source and then would be pushed onto the recorder after the 'answer', leading to a wrong order in the recorder. This could maybe also have been fixed by always pushing user choices into replay_source, and syncing the replay_source somehow after we enter a user choice, but the way it was done in this commit seemed easier.

note that replay_ and backlog were already made unused in da4cdef146bf5a1b8026f12d6b1caa6c1cd20602 (that was a rather uncomplete commit)
We maybe (i didnt test, just a guess) could also fix this bug by using add_nonundoable_command instead of add_command for nonundoable commands in replay.cpp with add_nonundoable_command  defined as:
config& add_nonundoable_command()
{
	auto c = cfg_.add_child_at("command",config(), pos_);
	pos_++;
	return c;
}
One reason why i decided against it is, that i feared add_child_at to be slow (vector::insert) if there are a lot of entries in cfg_ (for example when we join game that has already run may turns).
With the playturn_network_adapter this shouldn't be an issue anymore, but it also isnt needed anymore.
2014-04-11 23:04:57 +02:00
Andrius Silinskas
e3a05974b9 Use 'faction' and 'gender' attributes to provide default values in MP Create.
Before this, 'faction' and 'gender' were not used if 'force_lock_settings'
wasn't set to 'yes'. This resulted in inconsistent behaviour between the
mentioned two attributes and 'type' attribute. When 'type' was set, the relevant
leader was always selected by default.

This partially fixes bugs #21753 and #20562. To properly address them, it might
be needed to add 'faction_lock', 'type_lock' and 'gender_lock' attributes so
that UMC authors would have a way to actually lock these selections without
using 'force_lock_settings' if they don't want to.
2014-04-10 20:35:47 +01:00
mattsc
98509aa2bf Fix a typo
I had actually introduced this typo intentionally for testing purposes
and then forgotten to remove it.  :-P
2014-04-10 10:39:12 -07:00
mattsc
c4cb6168e4 Micro AIs: avoid using formula= in SUFs
It’s slow for finding units with moves or attacks left.  The
alternative method of getting all units and then looping over the table
with a condition is much faster.
2014-04-10 10:06:25 -07:00
mattsc
161470c149 Micro AIs: avoid using table.remove
It’s slow.  The inverse logic using table.insert is much faster,
especially for large tables.  Only kept table.remove in a couple places
where it doesn’t matter.
2014-04-10 07:36:45 -07:00
mattsc
a131572e09 Messenger Micro AI: minor code simplification 2014-04-10 07:36:44 -07:00
Iurii Chernyi
f1b0e66629 Merge pull request #144 from Kevin-Xi/bugfix
fix bugs and add comments on simple_move_and_targeting_phase
2014-04-10 15:58:45 +02:00
Kevin_Xi
cec4e06a0a fix bugs and add comments on simple_move_and_targeting_phase
fix bugs and add comments on simple_move_and_targeting_phase

fix bugs and add comments on simple_move_and_targeting_phase
2014-04-10 19:20:45 +08:00
Charles Dang
3ec612b063 UtBS S6a: fixed typo in comment 2014-04-10 02:57:03 -07:00
Charles Dang
def4c7cb3b THoT S12: fixed a typo and a missing word
Then -> Then
We will able -> We will be able
2014-04-10 02:53:51 -07:00
Charles Dang
8a80c370fe THoT S2: added mission period 2014-04-10 02:51:34 -07:00
Charles Dang
165210d8a3 THoT S1: improved a sentence 2014-04-10 02:49:51 -07:00
Charles Dang
578b4324fe NR S10a: fixed typo in comment 2014-04-10 02:46:34 -07:00
Charles Dang
b363705e96 NR S7a: fixed typo in a comment 2014-04-10 02:45:13 -07:00
Iurii Chernyi
47b4f52c9e Merge pull request #143 from Kevin-Xi/bugfix
fix minor bug in get_healing_phase
2014-04-10 11:13:07 +02:00
Charles Dang
45db6360e6 AOI S6: correct user_team_name for side 2 to Undead 2014-04-10 02:11:46 -07:00
Kevin_Xi
841284881a fix minor bug in get_healing_phase 2014-04-10 14:52:43 +08:00
mattsc
7fc8e9797b Micro AIs: avoid code duplication between eval and exec functions 2014-04-09 18:23:46 -07:00
mattsc
6f40ed8046 Micro AIs: use new fight_on_without_leader= key as needed
So that the scenarios with leaderless AI sides work.
2014-04-09 18:21:52 -07:00
gfgtdf
d1cd2e0b17 give do_replays return a better name
I forgot what my real intention with this change was, but i still think this is a good change, becasue now people don't have to look up the comments to see what do_replay returns.
So i committed it.
2014-04-09 19:51:08 +02:00
gfgtdf
22d17ba4dd remove unused argument 2014-04-09 19:51:04 +02:00
gfgtdf
6ce4e441a2 removed unused 'do_until' argument
we don't need this parameter anymore because we have the "dependent" key
in commands.
2014-04-09 19:51:02 +02:00
gfgtdf
a8dc92f5d6 use events::command_disabler in synced context
During the synced context we are in a state 'during an execution of an
event/action' that the savefile format cannot cover. So we use
command_disabler to prevent saving.
2014-04-09 19:51:01 +02:00
gfgtdf
5ffd7aebfd fix currently active side quits during action
this fixes a bug, that when we receive a player leave/controller change
during sync_network  called during an action the turn isn't restarted.
2014-04-09 19:51:00 +02:00
Alexander van Gessel
364a756b93 Merge branch 'master' of github.com:wesnoth/wesnoth 2014-04-09 17:06:42 +02:00
Alexander van Gessel
409744c449 Wrap some directory composition in get_dir 2014-04-09 17:06:07 +02:00
Alexander van Gessel
45f52737c8 Merge pull request #139 from aquileia/VC_project_update
Update project files
2014-04-09 08:17:30 +02:00
Chris Beck
84bad5a875 update changelog 2014-04-08 21:24:11 -04:00
Chris Beck
55e716428d [side_drop] sides go to idle, not human (fix bug 21459)
since idle sides don't get initialized until someone takes control
this alleviates 21459. it might possibly aggravate 21397, if that
bug is not fixed by correcting save files with unintialized sides
2014-04-08 20:13:56 -04:00
Chris Beck
81f9e29e40 refactor check_victory, don't use [side] no_leader attribute
1. sides without leaders aren't defeated if
"fight_on_without_leader = true". don't use no_leader
for this purpose anymore.
2. refactor to use a std::set instead of std::vector,
and some related improvements, for what was formerly
the "seen_leaders" data structure
2014-04-08 20:13:56 -04:00
Chris Beck
8c69c73739 add debugging output
help to determine victory conditions associated to victory_when_enemies_defeated
2014-04-08 20:13:56 -04:00
Chris Beck
ec379ce355 create "fight_on_without_leader" field of [side]
this field is intended to allow battles to continue after the death of a leader
if a side has this flag enabled and any units alive, they will be considered
to have a leader regardless of canrecruit.
2014-04-08 20:13:56 -04:00
Chris Beck
3f4879ace4 fix networked idle loop
somehow this was not implemented...
2014-04-08 20:13:56 -04:00
Chris Beck
22c565282a fixup idle loop
(this is probably a bugfix independent of the purpose of this branch)
2014-04-08 20:13:56 -04:00
Chris Beck
eae7ba9c5c fix whitespace 2014-04-08 20:13:56 -04:00
mattsc
cc6cecee2e Update changelogs 2014-04-07 19:43:06 -07:00