[Freeciv-Dev] (PR#40420) Editing mode allows adding units/cities to dead player

2008-08-15 Thread Madeline Book

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40420 

 [book - Wed Aug 13 20:40:57 2008]:
 
  [EMAIL PROTECTED] - Sat Aug 09 23:00:44 2008]:
  
  Or it could bring the dead player back to life...could be desirable
  for scenario editing but is a bit more work to code I'm sure.
 
 As far as I can see, all that is needed is to set
 pplayer-is_alive to TRUE, and send the player info.
 At least, I observed no immediate ill effects when
 I added code to do this when units or cities are
 created for already dead players (patch attached).

Committed to S2_2 (r15144) and trunk (r15147).


---
テーブルの下に鼠が三匹います。

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#40420) Editing mode allows adding units/cities to dead player

2008-08-13 Thread Madeline Book

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40420 

 [EMAIL PROTECTED] - Sat Aug 09 23:00:44 2008]:
 
 Or it could bring the dead player back to life...could be desirable
 for scenario editing but is a bit more work to code I'm sure.

As far as I can see, all that is needed is to set
pplayer-is_alive to TRUE, and send the player info.
At least, I observed no immediate ill effects when
I added code to do this when units or cities are
created for already dead players (patch attached).


--
信じてくれ!あの死体が動くのを自分の目で見たよ。
diff --git a/server/edithand.c b/server/edithand.c
index 6cae087..8f72fc3 100644
--- a/server/edithand.c
+++ b/server/edithand.c
@@ -429,6 +429,11 @@ void handle_edit_unit_create(struct connection *pc, int owner,
 return;
   }
 
+  if (count  0  !pplayer-is_alive) {
+pplayer-is_alive = TRUE;
+send_player_info(pplayer, NULL);
+  }
+
   /* FIXME: Make this more general? */
   coastal = is_sailing_unittype(punittype);
 
@@ -559,6 +564,11 @@ void handle_edit_city_create(struct connection *pc,
 return;
   }
 
+  if (!pplayer-is_alive) {
+pplayer-is_alive = TRUE;
+send_player_info(pplayer, NULL);
+  }
+
   conn_list_do_buffer(game.est_connections);
   map_show_tile(pplayer, ptile);
   create_city(pplayer, ptile, city_name_suggestion(pplayer, ptile));
___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#40420) Editing mode allows adding units/cities to dead player

2008-08-09 Thread Jason Dorje Short

URL: http://bugs.freeciv.org/Ticket/Display.html?id=40420 

Or it could bring the dead player back to life...could be desirable
for scenario editing but is a bit more work to code I'm sure.

-jason



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev