]> git.pond.sub.org Git - empserver/commitdiff
Unify owner of units built by deities in foreign sectors
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 13 Jan 2013 09:06:50 +0000 (10:06 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 8 May 2013 04:55:21 +0000 (06:55 +0200)
Newly built ships and land units are given to the player, planes and
nukes to the sector owner.  Matters only for deities, because only
deities can build in foreign sectors.  Stupid all the same.

This has always been inconsistent.  Empire 1 gave ships and nukes to
the player, and planes to the sector owner.  Chainsaw 3 added land
units, and gave them to the player.  Empire 2 changed build to give
nukes to the sector owner.

Building doesn't work when the unit built is given to POGO, because
giving a unit to POGO destroys it.  When build gives to the sector
owner, deities can't build in unowned sectors.  When build gives to
the player, POGO can't build at all.  That's more limiting, so change
build to always give to the sector owner.

src/lib/commands/buil.c

index 58bafa322278e79cdcd2a2da5ff2f2c5206834b3..651448ed17e0fa66fe2398d6180555324b055334 100644 (file)
@@ -28,7 +28,7 @@
  *
  *  Known contributors to this file:
  *     Steve McClure, 1998-2000
- *     Markus Armbruster, 2004-2012
+ *     Markus Armbruster, 2004-2013
  */
 
 #include <config.h>
@@ -260,7 +260,7 @@ build_ship(struct sctstr *sp, int type, int tlev)
     ef_blank(EF_SHIP, nstr.cur, &ship);
     ship.shp_x = sp->sct_x;
     ship.shp_y = sp->sct_y;
-    ship.shp_own = player->cnum;
+    ship.shp_own = sp->sct_own;
     ship.shp_type = mp - mchr;
     ship.shp_effic = SHIP_MINEFF;
     if (opt_MOB_ACCESS) {
@@ -273,7 +273,7 @@ build_ship(struct sctstr *sp, int type, int tlev)
     ship.shp_pstage = PLG_HEALTHY;
     ship.shp_ptime = 0;
     ship.shp_name[0] = 0;
-    ship.shp_orig_own = player->cnum;
+    ship.shp_orig_own = sp->sct_own;
     ship.shp_orig_x = sp->sct_x;
     ship.shp_orig_y = sp->sct_y;
     shp_set_tech(&ship, tlev);
@@ -373,7 +373,7 @@ build_land(struct sctstr *sp, int type, int tlev)
     ef_blank(EF_LAND, nstr.cur, &land);
     land.lnd_x = sp->sct_x;
     land.lnd_y = sp->sct_y;
-    land.lnd_own = player->cnum;
+    land.lnd_own = sp->sct_own;
     land.lnd_type = lp - lchr;
     land.lnd_effic = LAND_MINEFF;
     if (opt_MOB_ACCESS) {