Compare commits

...
Sign in to create a new pull request.

21 commits

Author SHA1 Message Date
9731e6692a Fix generation numbers for autonav
nav_ship() makes copies without going through ef_read(), and therefore
needs to mark them fresh by hand.
2009-04-24 23:52:00 +02:00
bdcd59155a Really, really fix bomb not to wipe out plane updates
Commit 82b5e3c2 missed escorts.
(cherry picked from commit ce7fab3868)
2009-04-19 22:06:08 +02:00
f571a37cde Fix tend land not to wipe out concurrent updates
Fix tend_land() to bail out if the tender changed while tend_land()
slept for the last argument (receiving ship).
(cherry picked from commit 1ee02194c5)
2009-04-19 22:06:08 +02:00
957f774a90 Fix return value of s_commod() when it can't draw enough
s_commod() could incorrectly claim success when the sink ended up with
at least as many supplies than were missing initially.  This caused a
number of problems:

* shp_torp() let a ship with two shells fire a torpedo, resulting in
  -1 shells, which then made item_prewrite() oops.  Affected missions
  and return fire, but not the torpedo command.

* shp_missile_defense() let a ship with one shell use missile defense,
  resulting in -1 shells, and the same item_prewrite() oops.

* Land units were considered in supply even when they had not quite
  enough supplies.  Such land units could defend without penalty,
  attack and react.  Commands load and lload weren't affected, because
  they use lnd_in_supply(), which doesn't use s_commod().

Broken in 98f24d5c, v4.3.20.
(cherry picked from commit 1329c0e544)
2009-04-16 13:07:47 +02:00
56f2ca96f7 Fix update to take dead units off carriers
upd_plane() upd_land() and left planes and land units lost to lack of
maintenance on their carriers.  Cargo lists were fine anyway, because
unit_cargo_init() ignored dead units.  But when the dead unit got
reused for building a new one, pln_prewrite() / lnd_prewrite() got
confused and attempted to take it off its carrier, which made
clink_rem() oops, because the unit wasn't on the cargo list.  No real
harm done, as oops recovery was fine.

Fix upd_plane() and upd_land() to clear the carrier.  Make
unit_cargo_init() oops when it finds dead units on carriers.
(cherry picked from commit c2c0d1ff77)
2009-04-15 23:07:26 +02:00
2900de1f63 Don't log out player when he interrupts a command
Broken in commit 3da4030a, v4.3.19.
(cherry picked from commit 475f518be1)
2009-03-22 09:03:36 +01:00
56c28caf5b Fix recipient thread in output journal
Output journaling was cherry-picked from Hvy Metal II.  However, how
threads are identified in the journal changed since then.
journal_output_1() needs updating for that.
2009-03-17 20:19:49 +01:00
b8804d1cc0 Fix typo in journaling of output lines
Screwed up in commit 9a19dc97.
2009-03-17 20:07:20 +01:00
551676d5f2 Document server time in info Hvy-Plastic 2009-03-16 19:50:08 +01:00
48ba06732c Fix assault not to send bogus telex to country 0
Happened when a spy got caught sneaking ashore and shot.
(cherry picked from commit 7c6e56bd02)
2009-03-10 20:52:36 +01:00
839c6001d3 Document disabling of anti-missile in info Hvy-Plastic 2009-03-10 20:52:26 +01:00
ddbf8c482b Change fairland island size probability distribution
Island size is randomly chosen from the interval [1..2*is+1], with
expected value is.  Use two dice to roll the size instead of one.
This makes extreme sizes much less likely.
2009-03-10 20:52:26 +01:00
8ebed5ba05 Fix generation numbers for news file
nreport() caches recent news reports in cache[], so it can collapse
multiple news reports into one.  Writing back such a collapsed news
report triggered a generation oops when the processor had been yielded
since the cached report was last written back.  But this is actually
perfectly safe, because the cache can't become stale: news file
updates either go through the cache (nreport()), or they clear the
entire cache (delete_old_news()).

Silence the oops by marking the news report fresh.

A case could be made for removing nws_generation alltogether.  Maybe
later.
2009-03-10 20:52:26 +01:00
bba8db34d0 Fix generation numbers for SAIL
fltp_to_list() makes copies without going through ef_read(), and
therefore needs to mark them fresh by hand.
2009-03-10 15:27:52 +01:00
20b31defe7 Generation numbers to catch write back of stale copies
Oops when a stale copy is written back, i.e. the processor was yielded
since the copy was made.  Such bugs are difficult to spot.  Sequence
numbers catch them when they do actual harm (they also catch different
bugs).  Generation numbers catch them even when they don't.

New ef_generation to count generations.  Call new ef_make_stale() to
step it whenever the processor may be yielded.

New struct emptypedstr member generation.  Make sure all members of
unit empobj_storage share it.  It is only used in copies; its value on
disk and in the cache is meaningless.  Set it to ef_generation by
calling new ef_mark_fresh() when making copies in ef_read() and
ef_blank().  Do the same in obj_changed() to make check_sect_ok() &
friends freshen their argument when it is unchanged.  Copies with
generation other than ef_generation are stale.

Oops in ef_write() when a stale copy is written back.
2009-03-10 15:27:52 +01:00
f8be963202 New info Hvy-Plastic 2009-03-10 15:27:52 +01:00
1bf3f557e9 Make fairland record the island number in the deity territory
Can be useful for deities when further customizing their game setup.
2009-03-10 15:27:52 +01:00
9a19dc973a Fix journalling of output ids 2009-03-10 15:27:52 +01:00
87512fb644 Journal output lines instead of chunks
Output often arrives in chunks other than lines.  Hard to read in the
journal.  Delay journalling until we got a full line or our buffer is
exhausted.  This is less precise, but it'll do for now.
2009-03-10 15:27:52 +01:00
c4687e15d5 New journal event output
To enable, set econfig key keep_journal to at least 2.  Output events
are *not* flushed to disk immediately.

Put it in Hvy Metal II now to gather real data for future testing of a
journal replay tool.
2009-03-10 15:27:51 +01:00
1c1fa720d4 New journal event command
Redundant information, but makes the journal easier to read.  The
redundancy might help making a journal replay tool robust.

Put it in Hvy Metal II now to gather some real data.
2009-03-10 15:27:51 +01:00
36 changed files with 225 additions and 12 deletions

View file

@ -45,6 +45,7 @@ struct comstr {
short ef_type;
short com_uid;
unsigned com_seqno;
unsigned com_generation;
time_t com_timestamp;
natid com_owner;
/* end of part matching struct empobj */

View file

@ -58,6 +58,7 @@ struct empobj {
short ef_type;
short uid;
unsigned seqno;
unsigned generation;
time_t timestamp;
/* end of part matching struct emptypedstr */
natid own; /* valid if EFF_OWNER is in table's flags */

View file

@ -88,6 +88,7 @@ struct emptypedstr {
short ef_type;
short uid;
unsigned seqno;
unsigned generation;
time_t timestamp;
};
@ -203,6 +204,8 @@ enum {
extern struct castr *ef_cadef(int);
extern int ef_read(int, int, void *);
extern void ef_make_stale(void);
extern void ef_mark_fresh(int, void *);
extern void *ef_ptr(int, int);
extern char *ef_nameof(int);
extern time_t ef_mtime(int);

View file

@ -41,6 +41,7 @@ struct gamestr {
short ef_type;
short game_uid;
unsigned game_seqno;
unsigned game_generation;
time_t game_timestamp;
/* end of part matching struct empobj */
char game_upd_disable; /* updates disabled? */

View file

@ -34,13 +34,17 @@
#ifndef JOURNAL_H
#define JOURNAL_H
struct player; /* FIXME temporary hack */
int journal_startup(void);
void journal_shutdown(void);
int journal_reopen(void);
void journal_login(void);
void journal_logout(void);
void journal_prng(unsigned);
void journal_output(struct player *, int, char *);
void journal_input(char *);
void journal_command(char *);
void journal_update(int);
#endif

View file

@ -52,6 +52,7 @@ struct lndstr {
short ef_type;
short lnd_uid; /* unit id (land unit) */
unsigned lnd_seqno;
unsigned lnd_generation;
time_t lnd_timestamp; /* Last time this unit was touched */
natid lnd_own; /* owner's country num */
coord lnd_x; /* x location in abs coords */

View file

@ -45,6 +45,7 @@ struct lonstr {
short ef_type;
short l_uid;
unsigned l_seqno;
unsigned l_generation;
time_t l_timestamp;
/* end of part matching struct empobj */
natid l_loner; /* loan shark */

View file

@ -42,6 +42,7 @@ struct loststr {
short ef_type;
short lost_uid;
unsigned lost_seqno;
unsigned lost_generation;
time_t lost_timestamp; /* When it was lost */
natid lost_owner; /* Who lost it */
/* end of part matching struct empobj */

View file

@ -73,6 +73,7 @@ struct realmstr {
short ef_type;
short r_uid; /* realm table index */
unsigned r_seqno;
unsigned r_generation;
time_t r_timestamp; /* Last time this realm was touched */
natid r_cnum; /* country number */
/* end of part matching struct empobj */
@ -86,6 +87,7 @@ struct natstr {
short ef_type;
short nat_uid; /* equals nat_cnum */
unsigned nat_seqno;
unsigned nat_generation;
time_t nat_timestamp;
natid nat_cnum; /* our country number */
/* end of part matching struct empobj */

View file

@ -49,6 +49,7 @@ struct nwsstr {
short ef_type;
short nws_uid;
unsigned nws_seqno;
unsigned nws_generation;
time_t nws_timestamp;
/* end of part matching struct empobj */
natid nws_ano; /* "actor" country # */

View file

@ -45,6 +45,7 @@ struct nukstr {
short ef_type;
short nuk_uid;
unsigned nuk_seqno;
unsigned nuk_generation;
time_t nuk_timestamp; /* Last time this nuke was touched */
natid nuk_own;
coord nuk_x, nuk_y; /* current loc of device */

View file

@ -49,6 +49,7 @@ struct plnstr {
short ef_type;
short pln_uid; /* plane unit id */
unsigned pln_seqno;
unsigned pln_generation;
time_t pln_timestamp; /* Last time this plane was touched */
natid pln_own; /* owning country */
coord pln_x; /* plane x-y */

View file

@ -47,6 +47,7 @@ struct sctstr {
short ef_type;
short sct_uid; /* equals XYOFFSET(sct_x, sct_y) */
unsigned sct_seqno;
unsigned sct_generation;
time_t sct_timestamp; /* Last time this sector was written to */
natid sct_own; /* owner's country num */
coord sct_x; /* x coord of sector */

View file

@ -66,6 +66,7 @@ struct shpstr {
short ef_type;
short shp_uid; /* unit id (ship #) */
unsigned shp_seqno;
unsigned shp_generation;
time_t shp_timestamp; /* Last time this ship was touched. */
natid shp_own; /* owner's country num */
coord shp_x; /* x location in abs coords */

View file

@ -45,6 +45,7 @@ struct trdstr {
short ef_type;
short trd_uid;
unsigned trd_seqno;
unsigned trd_generation;
time_t trd_timestamp;
natid trd_owner;
/* end of part matching struct empobj */

View file

@ -42,6 +42,7 @@ struct trtstr {
short ef_type;
short trt_uid;
unsigned trt_seqno;
unsigned trt_generation;
time_t trt_timestamp;
/* end of part matching struct empobj */
natid trt_cna; /* proposer */

54
info/Hvy-Plastic.t Normal file
View file

@ -0,0 +1,54 @@
.TH Concept "Hvy-Plastic"
.NA Hvy-Plastic "Special rules for Hvy Plastic"
.LV Basic
.s1
Ship types are customized. Better check show for the details.
.s1
Dreadnoughts are more heavily armored. Frigates are more fragile.
.s1
More ships can carry choppers. Some ships are not ideal for this, and
this is reflected by the lack of large petrol and shell storage.
.s1
Land unit types are heavily customized. Better check show for the
details. Non-mechanized units are slower and more vulnerable,
artillery firing ranges differ, few units are light (but troop
transports and landing ships can carry non-light units).
.s1
Planes are tweaked somewhat. show is your friend.
.s1
Nukes are on sale, but nuclear plants are not. Did I mention the show
command?
.s1
Infrastructure is disabled.
.s1
Your refineries make less petrol from each barrel of oil than usual.
.s1
Natural resources gold, oil and uran deplete much slower than usual.
A 100% gold resource contains 2500d, a 100% oil resource contains
2500o, and a 100% uranium resource contains 500u. Fully depleting a
sector will take you several updates, and a small fraction of the
resource contents will be lost.
.s1
Gold in mountains does not deplete at all.
.s1
Oil production does not depend on tech; you don't have to micro-manage
to conserve oil.
.s1
Ship capability anti-missile is disabled because of bugs.
.s1
Server time is in UTC, which means there will be no daylight savings
time.
.s1
Missed updates due to server problems will be forced if caught within
15 minutes of planned update time or skipped otherwise.
.s1
Everything you do in this game is logged by the deities for their own
nefarious purposes. However, the logs are treated confidentially.
.s1
Make the deity laugh and get up to 5 gold bars.
.s1
Source code and configuration is available from
.br
http://www.pond.sub.org/~armbru/empire/hvy-plastic.html
.s1
.SA "Introduction, Server, show"

View file

@ -181,7 +181,7 @@ assa(void)
pr(" and was killed in the attempt.\n");
llp->unit.land.lnd_effic = 0;
putland(llp->unit.land.lnd_uid, &llp->unit.land);
lnd_delete(llp, "");
lnd_delete(llp, NULL);
} else {
wu(0, def->own, "%s spy spotted in %s.\n",
cname(player->cnum), xyas(def->x, def->y,

View file

@ -157,6 +157,11 @@ bomb(void)
plp = (struct plist *)qp;
changed_plane_aborts(plp);
}
for (qp = esc_list.q_forw; qp != &esc_list; qp = next) {
next = qp->q_forw;
plp = (struct plist *)qp;
changed_plane_aborts(plp);
}
break;
case 's':
if (opt_SLOW_WAR) {

View file

@ -227,7 +227,7 @@ tend_land(struct shpstr *tenderp, char *units)
if (!snxtitem(&targets, EF_SHIP,
player->argp[4], "Ship to be tended? "))
return RET_FAIL;
if (!check_land_ok(&land))
if (!check_ship_ok(tenderp) || !check_land_ok(&land))
return RET_SYN;
while (nxtitem(&targets, &target)) {
if (!player->owner &&

View file

@ -241,24 +241,33 @@ unit_cargo_init(void)
unit_onresize(i);
for (i = 0; (pp = getplanep(i)); i++) {
if (!pp->pln_own)
if (!pp->pln_own) {
if (CANT_HAPPEN(pp->pln_ship >= 0 || pp->pln_land >= 0))
pp->pln_ship = pp->pln_land = -1;
continue;
}
if (CANT_HAPPEN(pp->pln_ship >= 0 && pp->pln_land >= 0))
pp->pln_land = -1;
pln_carrier_change(pp, EF_SHIP, -1, pp->pln_ship);
pln_carrier_change(pp, EF_LAND, -1, pp->pln_land);
}
for (i = 0; (lp = getlandp(i)); i++) {
if (!lp->lnd_own)
if (!lp->lnd_own) {
if (CANT_HAPPEN(lp->lnd_ship >= 0 || lp->lnd_land >= 0))
lp->lnd_ship = lp->lnd_land = -1;
continue;
}
if (CANT_HAPPEN(lp->lnd_ship >= 0 && lp->lnd_land >= 0))
lp->lnd_land = -1;
lnd_carrier_change(lp, EF_SHIP, -1, lp->lnd_ship);
lnd_carrier_change(lp, EF_LAND, -1, lp->lnd_land);
}
for (i = 0; (np = getnukep(i)); i++) {
if (!np->nuk_own)
if (!np->nuk_own) {
if (CANT_HAPPEN(np->nuk_plane >= 0))
np->nuk_plane = -1;
continue;
}
nuk_carrier_change(np, EF_PLANE, -1, np->nuk_plane);
}
}

View file

@ -52,9 +52,12 @@ static int do_read(struct empfile *, void *, int, int);
static int do_write(struct empfile *, void *, int, int);
static unsigned get_seqno(struct empfile *, int);
static void new_seqno(struct empfile *, void *);
static void must_be_fresh(struct empfile *, void *);
static void do_blank(struct empfile *, void *, int, int);
static int ef_check(int);
static unsigned ef_generation;
/*
* Open the file-backed table TYPE (EF_SECTOR, ...).
* HOW are flags to control operation. Naturally, immutable flags are
@ -338,6 +341,7 @@ ef_read(int type, int id, void *into)
cachep = ep->cache + (id - ep->baseid) * ep->size;
}
memcpy(into, cachep, ep->size);
ef_mark_fresh(type, into);
if (ep->postread)
ep->postread(id, into);
@ -500,9 +504,11 @@ ef_write(int type, int id, void *from)
if (ep->onresize && ep->onresize(type) < 0)
return 0;
}
if (id >= ep->baseid && id < ep->baseid + ep->cids)
if (id >= ep->baseid && id < ep->baseid + ep->cids) {
cachep = ep->cache + (id - ep->baseid) * ep->size;
else
if (cachep != from)
must_be_fresh(ep, from);
} else
cachep = NULL;
if (ep->prewrite)
ep->prewrite(id, cachep, from);
@ -586,6 +592,35 @@ new_seqno(struct empfile *ep, void *buf)
elt->seqno = old_seqno + 1;
}
void
ef_make_stale(void)
{
ef_generation++;
}
void
ef_mark_fresh(int type, void *buf)
{
struct empfile *ep;
if (ef_check(type) < 0)
return;
ep = &empfile[type];
if (!(ep->flags & EFF_TYPED))
return;
((struct emptypedstr *)buf)->generation = ef_generation;
}
static void
must_be_fresh(struct empfile *ep, void *buf)
{
struct emptypedstr *elt = buf;
if (!(ep->flags & EFF_TYPED))
return;
CANT_HAPPEN(elt->generation != ef_generation);
}
/*
* Extend table TYPE by COUNT elements.
* Any pointers obtained from ef_ptr() become invalid.
@ -663,6 +698,7 @@ ef_blank(int type, int id, void *buf)
elt = buf;
elt->seqno = get_seqno(ep, elt->uid);
}
ef_mark_fresh(type, buf);
}
/*

View file

@ -51,6 +51,7 @@
#include <unistd.h>
#include "empio.h"
#include "empthread.h"
#include "file.h"
#include "ioqueue.h"
#include "misc.h"
#include "queue.h"
@ -123,6 +124,9 @@ io_input(struct iop *iop, int waitforinput)
int cc;
int res;
if (waitforinput)
ef_make_stale();
/* Not a read IOP */
if ((iop->flags & IO_READ) == 0) {
errno = EBADF;
@ -183,6 +187,9 @@ io_output(struct iop *iop, int waitforoutput)
int n;
int remain;
if (waitforoutput)
ef_make_stale();
/* If there is no output waiting. */
if (!io_outputwaiting(iop))
return 0;
@ -264,6 +271,9 @@ io_write(struct iop *iop, char *buf, int nbytes, int doWait)
{
int len;
if (doWait)
ef_make_stale();
if ((iop->flags & IO_WRITE) == 0)
return -1;
ioq_append(iop->output, buf, nbytes);
@ -285,6 +295,8 @@ io_output_all(struct iop *iop)
{
int n;
ef_make_stale();
/*
* Mustn't block a player thread while update is pending, or else
* a malicous player could delay the update indefinitely

View file

@ -37,6 +37,7 @@
#include <signal.h>
#include <time.h>
#include "empthread.h"
#include "file.h"
#include "misc.h"
/* Flags that were passed to empth_init() */
@ -65,6 +66,7 @@ empth_create(void (*entry)(void *), int size, int flags,
{
if (!flags)
flags = empth_flags;
ef_make_stale();
return lwpCreate(1, entry, size, flags, name, 0, 0, ud);
}
@ -89,18 +91,21 @@ empth_set_name(empth_t *thread, char *name)
void
empth_exit(void)
{
ef_make_stale();
lwpExit();
}
void
empth_yield(void)
{
ef_make_stale();
lwpYield();
}
int
empth_select(int fd, int flags, struct timeval *timeout)
{
ef_make_stale();
return lwpSleepFd(fd, flags, timeout);
}
@ -113,6 +118,7 @@ empth_wakeup(empth_t *a)
int
empth_sleep(time_t until)
{
ef_make_stale();
return lwpSleepUntil(until);
}
@ -123,6 +129,7 @@ empth_wait_for_signal(void)
int sig, err;
time_t now;
ef_make_stale();
sigemptyset(&set);
sigaddset(&set, SIGHUP);
sigaddset(&set, SIGINT);
@ -153,12 +160,14 @@ empth_rwlock_destroy(empth_rwlock_t *rwlock)
void
empth_rwlock_wrlock(empth_rwlock_t *rwlock)
{
ef_make_stale();
lwp_rwlock_wrlock(rwlock);
}
void
empth_rwlock_rdlock(empth_rwlock_t *rwlock)
{
ef_make_stale();
lwp_rwlock_rdlock(rwlock);
}

View file

@ -38,6 +38,7 @@
#include "com.h"
#include "empio.h"
#include "file.h"
#include "journal.h"
#include "match.h"
#include "misc.h"
#include "nat.h"
@ -102,6 +103,7 @@ dispatch(char *buf, char *redir)
uprnf(buf);
pr("\n");
}
journal_command(command->c_form);
switch (command->c_addr()) {
case RET_OK:
player->btused += command->c_cost;

View file

@ -121,7 +121,7 @@ command(void)
time_t now;
if (getcommand(player->combuf) < 0)
return 0;
return player->aborted;
now = time(NULL);
update_timeused(now);

View file

@ -52,7 +52,11 @@ obj_changed(struct empobj *obj, size_t sz)
get_empobj(obj->ef_type, obj->uid, &old);
memcpy(&tobj, obj, sz);
old.gen.timestamp = tobj.gen.timestamp = 0;
return memcmp(&tobj, &old, sz);
old.gen.generation = tobj.gen.generation = 0;
if (memcmp(&tobj, &old, sz))
return 1;
ef_mark_fresh(obj->ef_type, obj);
return 0;
}
int

View file

@ -44,7 +44,9 @@
* prng NAME SEED
* login CNUM HOSTADDR USER
* logout CNUM
* command NAME
* input INPUT
* output THREAD ID OUTPUT
* update ETU
*/
@ -67,6 +69,7 @@ static FILE *journal;
static void journal_entry(char *fmt, ...)
ATTRIBUTE((format (printf, 1, 2)));
static void journal_output_1(struct player *, int, char *, char *, int);
static FILE *
journal_open(void)
@ -98,6 +101,7 @@ journal_entry(char *fmt, ...)
fprintf(journal, "\\%03o", *p);
}
fputs("\n", journal);
if (fmt[0] != 'o') /* FIXME disgusting hack */
fflush(journal);
if (ferror(journal)) {
logerror("Error writing journal (%s)", strerror(errno));
@ -167,12 +171,57 @@ journal_logout(void)
journal_entry("logout %d", player->cnum);
}
void
journal_output(struct player *pl, int id, char *output)
{
static char buf[1024];
static struct player *bpl;
static int bid;
char *s, *e;
if (keep_journal < 2)
return;
if (buf[0] && (pl != bpl && id != bid)) {
journal_output_1(bpl, bid, buf, "", -1);
buf[0] = 0;
}
for (s = output; (e = strchr(s, '\n')); s = e + 1) {
journal_output_1(pl, id, buf, s, (int)(e + 1 - s));
buf[0] = 0;
}
if (strlen(buf) + strlen(s) < 1024) {
strcpy(buf + strlen(buf), s);
bpl = pl;
bid = id;
} else {
journal_output_1(pl, id, buf, s, -1);
buf[0] = 0;
}
}
static void
journal_output_1(struct player *pl, int id,
char *buf1, char *buf2, int buf2prec)
{
journal_entry("output %s %d %s%.*s",
empth_name(empth_self()), id, buf1, buf2prec, buf2);
}
void
journal_input(char *input)
{
journal_entry("input %s", input);
}
void
journal_command(char *cmd)
{
char *eptr = strchr(cmd, ' ');
journal_entry("command %.*s", eptr ? (int)(eptr - cmd) : -1, cmd);
}
void
journal_update(int etu)
{

View file

@ -61,6 +61,8 @@ nreport(natid actor, int event, natid victim, int times)
return;
np = ncache(actor, event, victim, times);
/* TODO get rid of nws_generation? */
ef_mark_fresh(EF_NEWS, np);
putnews(np->nws_uid, np);
/*

View file

@ -56,6 +56,7 @@
#include "com.h"
#include "empio.h"
#include "file.h"
#include "journal.h"
#include "misc.h"
#include "nat.h"
#include "player.h"
@ -124,6 +125,7 @@ pr_id(struct player *p, int id, char *format, ...)
if (p->curid >= 0) {
io_puts(p->iop, "\n");
journal_output(p, p->curid, "\n");
p->curid = -1;
}
va_start(ap, format);
@ -245,6 +247,7 @@ pr_player(struct player *pl, int id, char *buf)
bp += len;
}
}
journal_output(pl, id, buf);
}
/*
@ -299,6 +302,7 @@ upr_player(struct player *pl, int id, char *buf)
io_puts(pl->iop, printbuf);
}
}
journal_output(pl, id, buf);
}
/*

View file

@ -402,7 +402,7 @@ s_commod(struct empobj *sink, short *vec,
if (actually_doit)
put_empobj(sink->ef_type, sink->uid, sink);
return wanted <= vec[type];
return 0;
}
/*

View file

@ -125,6 +125,7 @@ upd_land(struct lndstr *lp, int etus,
makelost(EF_LAND, lp->lnd_own, lp->lnd_uid,
lp->lnd_x, lp->lnd_y);
lp->lnd_own = 0;
lp->lnd_ship = lp->lnd_land = -1;
return;
}
wu(0, lp->lnd_own,

View file

@ -268,6 +268,7 @@ nav_ship(struct shpstr *sp)
mlp = malloc(sizeof(struct ulist));
mlp->chrp = (struct empobj_chr *)(mchr + sp->shp_type);
mlp->unit.ship = *sp;
ef_mark_fresh(EF_SHIP, &mlp->unit.ship);
mlp->mobil = sp->shp_mobil;
emp_insque(&mlp->queue, &ship_list);

View file

@ -110,6 +110,7 @@ upd_plane(struct plnstr *pp, int etus,
makelost(EF_PLANE, pp->pln_own, pp->pln_uid,
pp->pln_x, pp->pln_y);
pp->pln_own = 0;
pp->pln_ship = pp->pln_land = -1;
return;
}
wu(0, pp->pln_own,

View file

@ -347,6 +347,7 @@ fltp_to_list(struct fltheadstr *fltp, struct emp_qelem *list)
sp = getshipp(fe->num);
mlp->chrp = (struct empobj_chr *)(mchr + sp->shp_type);
mlp->unit.ship = *sp;
ef_mark_fresh(EF_SHIP, &mlp->unit.ship);
mlp->mobil = fe->mobil;
emp_insque(&mlp->queue, list);
}

View file

@ -821,7 +821,7 @@ grow_islands(void)
secs = 0;
if (!place_island(c, &x, &y))
return;
isiz = 1 + rnd(2 * is - 1);
isiz = 1 + rnd(is) + rnd(is);
do {
++secs;
find_coast(c);
@ -1092,6 +1092,7 @@ write_sects(void)
sct->sct_type = SCT_MOUNT;
sct->sct_elev = total;
sct->sct_newtype = sct->sct_type;
sct->sct_dterr = own[sct->sct_x][y] + 1;
if (ORE)
add_resources(sct);
}