Set timestamp automatically on write

Do it in do_write().  Remove the setting of timestamps elsewhere.

This fixes empdump to set timestamps to the current time instead of
zero on import.
This commit is contained in:
Markus Armbruster 2008-03-05 22:43:10 +01:00
parent a680c81110
commit f33b96b1d1
11 changed files with 12 additions and 38 deletions

View file

@ -118,11 +118,6 @@ lnd_prewrite(int n, void *ptr)
struct plnstr *pp;
int i;
llp->ef_type = EF_LAND;
llp->lnd_uid = n;
time(&llp->lnd_timestamp);
if (llp->lnd_own && llp->lnd_effic < LAND_MINEFF) {
makelost(EF_LAND, llp->lnd_own, llp->lnd_uid,
llp->lnd_x, llp->lnd_y);

View file

@ -51,7 +51,6 @@ makelost(short type, natid owner, short id, coord x, coord y)
lost.lost_id = id;
lost.lost_x = x;
lost.lost_y = y;
time(&lost.lost_timestamp);
putlost(n, &lost);
}
@ -66,7 +65,6 @@ makenotlost(short type, natid owner, short id, coord x, coord y)
return;
getlost(n, &lost);
lost.lost_owner = 0;
lost.lost_timestamp = 0;
putlost(n, &lost);
}

View file

@ -56,7 +56,6 @@ nat_reset(struct natstr *natp, enum nat_status stat, coord x, coord y)
struct realmstr newrealm;
struct range absrealm;
char buf[1024];
time_t now = time(NULL);
int i;
natp->nat_stat = stat;
@ -76,7 +75,6 @@ nat_reset(struct natstr *natp, enum nat_status stat, coord x, coord y)
newrealm.r_xh = absrealm.hx;
newrealm.r_yl = absrealm.ly;
newrealm.r_yh = absrealm.hy;
newrealm.r_timestamp = now;
putrealm(&newrealm);
}
if (players_at_00) {

View file

@ -88,11 +88,6 @@ nuk_prewrite(int n, void *ptr)
np->nuk_effic = 0;
}
np->ef_type = EF_NUKE;
np->nuk_uid = n;
time(&np->nuk_timestamp);
getnuke(n, &nuke);
return 1;

View file

@ -131,11 +131,6 @@ pln_prewrite(int n, void *ptr)
}
}
}
pp->ef_type = EF_PLANE;
pp->pln_uid = n;
time(&pp->pln_timestamp);
getplane(n, &plane);
return 1;

View file

@ -68,8 +68,6 @@ sct_prewrite(int id, void *ptr)
struct sctstr *sp = ptr;
struct sctstr sect;
time(&sp->sct_timestamp);
bridge_damaged(sp, NULL);
checksect(sp);
getsect(sp->sct_x, sp->sct_y, &sect);

View file

@ -71,11 +71,6 @@ shp_prewrite(int n, void *ptr)
struct plnstr *pp;
int i;
sp->ef_type = EF_SHIP;
sp->shp_uid = n;
time(&sp->shp_timestamp);
if (sp->shp_own != 0 && sp->shp_effic < SHIP_MINEFF) {
mpr(sp->shp_own, "\t%s sunk!\n", prship(sp));
makelost(EF_SHIP, sp->shp_own, sp->shp_uid, sp->shp_x, sp->shp_y);