[Freeciv-Dev] Re: (PR#10034) no contact with adjacent player
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=10034 >
Maybe I pick right patch version this time...
- Caz
diff -Nurd -X.diff_ignore freeciv/server/barbarian.c freeciv/server/barbarian.c
--- freeciv/server/barbarian.c 2004-09-11 18:08:15.359375000 +0300
+++ freeciv/server/barbarian.c 2004-09-12 08:43:48.171875000 +0300
@@ -140,7 +140,6 @@
}
set_ai_level_directer(barbarians, game.skill_level);
init_tech(barbarians, game.tech);
- ai_data_init(barbarians);
/* Ensure that we are at war with everyone else */
players_iterate(pplayer) {
diff -Nurd -X.diff_ignore freeciv/server/plrhand.c freeciv/server/plrhand.c
--- freeciv/server/plrhand.c 2004-09-11 18:08:18.828125000 +0300
+++ freeciv/server/plrhand.c 2004-09-12 08:51:36.656250000 +0300
@@ -1548,6 +1548,7 @@
if (initmap) {
player_map_allocate(pplayer);
}
+ pplayer->player_no = pplayer-game.players;
ai_data_init(pplayer);
}
@@ -1625,6 +1626,8 @@
check_city_workers(pplayer1);
check_city_workers(pplayer2);
return;
+ } else {
+ assert(pplayer_get_diplstate(pplayer2, pplayer1)->type != DS_NO_CONTACT);
}
if (player_has_embassy(pplayer1, pplayer2)
|| player_has_embassy(pplayer2, pplayer1)) {
@@ -1809,7 +1812,6 @@
/* make a new player */
server_player_init(cplayer, TRUE);
- ai_data_init(cplayer);
/* select a new name and nation for the copied player. */
/* Rebel will always be an AI player */
@@ -1822,29 +1824,42 @@
cplayer->revolution_finishes = game.turn + 1;
cplayer->capital = TRUE;
- /* This should probably be DS_NEUTRAL when AI knows about diplomacy,
- * but for now AI players are always at war.
- */
+ /* cplayer is not yet part of players_iterate which goes only
+ to game.nplayers. */
players_iterate(other_player) {
- cplayer->diplstates[other_player->player_no].type = DS_NEUTRAL;
+ /* Barbarians are at war with everybody */
+ if (is_barbarian(other_player)) {
+ cplayer->diplstates[other_player->player_no].type = DS_WAR;
+ other_player->diplstates[cplayer->player_no].type = DS_WAR;
+ } else {
+ cplayer->diplstates[other_player->player_no].type = DS_NO_CONTACT;
+ other_player->diplstates[cplayer->player_no].type = DS_NO_CONTACT;
+ }
+
cplayer->diplstates[other_player->player_no].has_reason_to_cancel = 0;
cplayer->diplstates[other_player->player_no].turns_left = 0;
- other_player->diplstates[cplayer->player_no].type = DS_NEUTRAL;
+ cplayer->diplstates[other_player->player_no].contact_turns_left = 0;
other_player->diplstates[cplayer->player_no].has_reason_to_cancel = 0;
other_player->diplstates[cplayer->player_no].turns_left = 0;
+ other_player->diplstates[cplayer->player_no].contact_turns_left = 0;
/* Send so that other_player sees updated diplomatic info;
- * cplayer and pplayer will be sent later anyway
+ * pplayer will be sent later anyway
*/
- if (other_player != cplayer && other_player != pplayer) {
+ if (other_player != pplayer) {
send_player_info(other_player, other_player);
}
}
players_iterate_end;
+ game.nplayers++;
+ game.max_players = game.nplayers;
+
/* Split the resources */
- cplayer->economic.gold = pplayer->economic.gold/2;
+ cplayer->economic.gold = pplayer->economic.gold;
+ cplayer->economic.gold /= 2;
+ pplayer->economic.gold -= cplayer->economic.gold;
/* Copy the research */
@@ -1877,7 +1892,6 @@
pplayer->government = game.government_when_anarchy;
pplayer->revolution_finishes = game.turn + 1;
}
- pplayer->economic.gold = cplayer->economic.gold;
pplayer->research.bulbs_researched = 0;
pplayer->embassy = 0; /* all embassies destroyed */
@@ -1897,9 +1911,6 @@
give_map_from_player_to_player(pplayer, cplayer);
- game.nplayers++;
- game.max_players = game.nplayers;
-
/* Not sure if this is necessary, but might be a good idea
to avoid doing some ai calculations with bogus data:
*/
@@ -1917,16 +1928,13 @@
* The capture of a capital is not a sure fire way to throw
and empire into civil war. Some governments are more susceptible
than others, here are the base probabilities:
- * Anarchy 90%
+Anarchy 90%
Despotism 80%
Monarchy 70%
-Fundamentalism 60% (In case it gets implemented one day)
+Fundamentalism 60% (Only in civ2 ruleset)
Communism 50%
- Republic 40%
-Democracy 30%
- * Note: In the event that Fundamentalism is added, you need to
-update the array government_civil_war[G_LAST] in player.c
- * [ SKi: That would now be data/default/governments.ruleset. ]
+Republic 40%
+Democracy 30%
* In addition each city in revolt adds 5%, each city in rapture
subtracts 5% from the probability of a civil war.
* If you have at least 1 turns notice of the impending loss of
- [Freeciv-Dev] Re: (PR#10034) no contact with adjacent player, Jason Short, 2004/09/10
- [Freeciv-Dev] (PR#10034) no contact with adjacent player, Brett Albertson, 2004/09/10
- [Freeciv-Dev] Re: (PR#10034) no contact with adjacent player, Marko Lindqvist, 2004/09/11
- [Freeciv-Dev] Re: (PR#10034) no contact with adjacent player, Marko Lindqvist, 2004/09/11
- [Freeciv-Dev] Re: (PR#10034) no contact with adjacent player, Jason Short, 2004/09/11
- [Freeciv-Dev] Re: (PR#10034) no contact with adjacent player, Marko Lindqvist, 2004/09/11
- [Freeciv-Dev] Re: (PR#10034) no contact with adjacent player, Marko Lindqvist, 2004/09/11
- [Freeciv-Dev] Re: (PR#10034) no contact with adjacent player, Jason Short, 2004/09/11
- [Freeciv-Dev] Re: (PR#10034) no contact with adjacent player, Marko Lindqvist, 2004/09/12
- [Freeciv-Dev] Re: (PR#10034) no contact with adjacent player,
Marko Lindqvist <=
- [Freeciv-Dev] Re: (PR#10034) no contact with adjacent player, Marko Lindqvist, 2004/09/18
|
|