[Freeciv-Dev] Re: (PR#4102) contact and intelligence
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients:; |
Subject: |
[Freeciv-Dev] Re: (PR#4102) contact and intelligence |
From: |
"Per I. Mathisen" <per@xxxxxxxxxxx> |
Date: |
Sat, 10 May 2003 17:45:14 -0700 |
Reply-to: |
rt@xxxxxxxxxxxxxx |
On Tue, 29 Apr 2003, ue80@xxxxxxxxxxxxxxxxxxxxx wrote:
> > So how about this: We can intelligence dialog info from someone we're in
> > contact with (not yet embassy), but we can't see their techs, including
> > what you are currently researching. That's easy to do. Hence, when you
> > open up the diplomacy dialog, you can give your own techs to the other
> > side, and he can put his techs on the table, but you can't suggest _his_
> > techs into the proposal, because you don't know and can't see what techs
> > he has.
>
> That's ok .. and its the same as it is for cities now.
Here is the patch. Please test & comment. It requires the previously
posted intlbugfix1.diff, though, or all it will do is produce fine core
files on your hdd.
- Per
Index: client/civclient.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/civclient.c,v
retrieving revision 1.169
diff -u -r1.169 civclient.c
--- client/civclient.c 3 May 2003 20:20:15 -0000 1.169
+++ client/civclient.c 11 May 2003 00:39:12 -0000
@@ -850,9 +850,7 @@
**************************************************************************/
bool can_intel_with_player(struct player *pplayer)
{
- return (pplayer->is_alive
- && pplayer != game.player_ptr
- && player_has_embassy(game.player_ptr, pplayer));
+ return could_intel_with_player(game.player_ptr, pplayer);
}
/**************************************************************************
Index: common/diptreaty.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/diptreaty.c,v
retrieving revision 1.15
diff -u -r1.15 diptreaty.c
--- common/diptreaty.c 17 Apr 2003 20:06:36 -0000 1.15
+++ common/diptreaty.c 11 May 2003 00:39:12 -0000
@@ -44,6 +44,19 @@
&& pplayer->is_connected);
}
+/**************************************************************************
+ Returns TRUE iff pplayer could do diplomatic meetings with aplayer.
+**************************************************************************/
+bool could_intel_with_player(struct player *pplayer, struct player *aplayer)
+{
+ return (pplayer->is_alive
+ && aplayer->is_alive
+ && pplayer != aplayer
+ && (pplayer->diplstates[aplayer->player_no].contact_turns_left > 0
+ || aplayer->diplstates[pplayer->player_no].contact_turns_left > 0
+ || player_has_embassy(pplayer, aplayer)));
+}
+
/****************************************************************
...
*****************************************************************/
Index: common/diptreaty.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/diptreaty.h,v
retrieving revision 1.10
diff -u -r1.10 diptreaty.h
--- common/diptreaty.h 17 Apr 2003 20:06:36 -0000 1.10
+++ common/diptreaty.h 11 May 2003 00:39:12 -0000
@@ -46,6 +46,7 @@
};
bool could_meet_with_player(struct player *pplayer, struct player *aplayer);
+bool could_intel_with_player(struct player *pplayer, struct player *aplayer);
void init_treaty(struct Treaty *ptreaty,
struct player *plr0, struct player *plr1);
Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.271
diff -u -r1.271 plrhand.c
--- server/plrhand.c 10 May 2003 19:20:16 -0000 1.271
+++ server/plrhand.c 11 May 2003 00:39:13 -0000
@@ -1145,26 +1145,20 @@
info_level = min_info_level;
}
- if (info_level >= INFO_MEETING) {
+ for (i = A_FIRST; i < game.num_tech_types; i++) {
+ packet->inventions[i] = '0';
+ }
+ /* We have to inform the client that the other players also know
+ * A_NONE. */
+ packet->inventions[A_NONE] = plr->research.inventions[A_NONE].state + '0';
+ packet->inventions[i] = '\0';
+
+ if (info_level >= INFO_MINIMUM) {
packet->gold = plr->economic.gold;
- for (i = A_NONE; i < game.num_tech_types; i++) {
- packet->inventions[i] = plr->research.inventions[i].state + '0';
- }
packet->inventions[i] = '\0';
packet->government = plr->government;
} else {
packet->gold = 0;
- for (i = A_NONE; i < game.num_tech_types; i++) {
- packet->inventions[i] = '0';
- }
-
- /*
- * We have to inform the client that the other players also know
- * A_NONE.
- */
- packet->inventions[A_NONE] =
- plr->research.inventions[A_NONE].state + '0';
- packet->inventions[i] = '\0';
/* Ideally, we should check whether receiver really sees any cities owned
* by player before this. */
@@ -1177,6 +1171,9 @@
}
if (info_level >= INFO_EMBASSY) {
+ for (i = A_FIRST; i < game.num_tech_types; i++) {
+ packet->inventions[i] = plr->research.inventions[i].state + '0';
+ }
packet->tax = plr->economic.tax;
packet->science = plr->economic.science;
packet->luxury = plr->economic.luxury;
@@ -1268,7 +1265,7 @@
if (receiver && player_has_embassy(receiver, plr)) {
return INFO_EMBASSY;
}
- if (receiver && find_treaty(plr, receiver)) {
+ if (receiver && could_intel_with_player(receiver, plr)) {
return INFO_MEETING;
}
return INFO_MINIMUM;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Freeciv-Dev] Re: (PR#4102) contact and intelligence,
Per I. Mathisen <=
|
|