New lost_and_found() to record ownership changes.

Factors out the common makelost()/makenotlost() pattern.
This commit is contained in:
Markus Armbruster 2008-09-06 11:48:49 -04:00
parent 0d139ee1d1
commit 136132773b
8 changed files with 32 additions and 44 deletions

View file

@ -84,14 +84,9 @@ nuk_prewrite(int n, void *old, void *new)
own = 0;
/* We've avoided assigning to np->nuk_own, in case oldsp == sp */
if (oldnp->nuk_own != own) {
if (oldnp->nuk_own)
makelost(EF_NUKE, oldnp->nuk_own,
np->nuk_uid, np->nuk_x, np->nuk_y);
if (own)
makenotlost(EF_NUKE, own,
np->nuk_uid, np->nuk_x, np->nuk_y);
}
if (oldnp->nuk_own != own)
lost_and_found(EF_NUKE, oldnp->nuk_own, own,
np->nuk_uid, np->nuk_x, np->nuk_y);
np->nuk_own = own;
}