Don't write garbage to unused trade destination in trade file

struct trdstr members trd_x, trd_y are used only for teleporting
trades.  For others, trad() wrote garbage coordinates to the trade
file.  They weren't used except by xdump.  Fortunately, even there
they're visible only to deities.

Write invalid coordinates instead.  Do that in set() as well, so that
coordinates are valid only when we have a teleport destination.

Spotted by the Clang Static Analyzer.
This commit is contained in:
Markus Armbruster 2010-06-27 11:35:08 +02:00
parent 8c78b1188b
commit 10736cd157
3 changed files with 10 additions and 10 deletions

View file

@ -54,7 +54,7 @@ struct trdstr {
long trd_price;
int trd_maxbidder;
time_t trd_markettime;
coord trd_x;
coord trd_x; /* destination for teleporting trade */
coord trd_y;
};