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

@ -39,6 +39,20 @@
static int findlost(short, natid, short, coord, coord, int);
/*
* Record item ID of type TYPE changed owner from EXOWN to OWN at X, Y.
*/
void
lost_and_found(int type, natid exown, natid own, int id, coord x, coord y)
{
if (exown == own)
return;
if (exown)
makelost(type, exown, id, x, y);
if (own)
makenotlost(type, own, id, x, y);
}
void
makelost(short type, natid owner, short id, coord x, coord y)
{