… | |
… | |
32 | #include <bitset> |
32 | #include <bitset> |
33 | |
33 | |
34 | UUID UUID::cur; |
34 | UUID UUID::cur; |
35 | static uint64_t seq_next_save; |
35 | static uint64_t seq_next_save; |
36 | static const uint64 UUID_GAP = 1<<19; |
36 | static const uint64 UUID_GAP = 1<<19; |
|
|
37 | uint32_t mapspace::smellcount = 10000; |
37 | |
38 | |
38 | objectvec objects; |
39 | objectvec objects; |
39 | activevec actives; |
40 | activevec actives; |
40 | |
41 | |
41 | short freearr_x[SIZEOFFREE] = { |
42 | short freearr_x[SIZEOFFREE] = { |
… | |
… | |
1096 | |
1097 | |
1097 | if (object *pl = ms.player ()) |
1098 | if (object *pl = ms.player ()) |
1098 | { |
1099 | { |
1099 | if (is_player ()) |
1100 | if (is_player ()) |
1100 | { |
1101 | { |
|
|
1102 | if (!flag [FLAG_WIZPASS]) |
1101 | ms.smell = pticks; // remember the smell of the player |
1103 | ms.smell = ++mapspace::smellcount; // remember the smell of the player |
1102 | |
1104 | |
1103 | // leaving a spot always closes any open container on the ground |
1105 | // leaving a spot always closes any open container on the ground |
1104 | if (container && !container->env) |
1106 | if (container && !container->env) |
1105 | // this causes spurious floorbox updates, but it ensures |
1107 | // this causes spurious floorbox updates, but it ensures |
1106 | // that the CLOSE event is being sent. |
1108 | // that the CLOSE event is being sent. |
… | |
… | |
1284 | |
1286 | |
1285 | /* Ideally, the caller figures this out. However, it complicates a lot |
1287 | /* Ideally, the caller figures this out. However, it complicates a lot |
1286 | * of areas of callers (eg, anything that uses find_free_spot would now |
1288 | * of areas of callers (eg, anything that uses find_free_spot would now |
1287 | * need extra work |
1289 | * need extra work |
1288 | */ |
1290 | */ |
|
|
1291 | maptile *newmap = m; |
1289 | if (!xy_normalise (m, op->x, op->y)) |
1292 | if (!xy_normalise (newmap, op->x, op->y)) |
1290 | { |
1293 | { |
1291 | op->head_ ()->destroy ();// remove head_ once all tail object destroyers found |
1294 | op->head_ ()->destroy ();// remove head_ once all tail object destroyers found |
1292 | return 0; |
1295 | return 0; |
1293 | } |
1296 | } |
1294 | |
1297 | |
… | |
… | |
1296 | if (!insert_ob_in_map (more, m, originator, flag)) |
1299 | if (!insert_ob_in_map (more, m, originator, flag)) |
1297 | return 0; |
1300 | return 0; |
1298 | |
1301 | |
1299 | CLEAR_FLAG (op, FLAG_REMOVED); |
1302 | CLEAR_FLAG (op, FLAG_REMOVED); |
1300 | |
1303 | |
1301 | op->map = m; |
1304 | op->map = newmap; |
1302 | mapspace &ms = op->ms (); |
1305 | mapspace &ms = op->ms (); |
1303 | |
1306 | |
1304 | /* this has to be done after we translate the coordinates. |
1307 | /* this has to be done after we translate the coordinates. |
1305 | */ |
1308 | */ |
1306 | if (op->nrof && !(flag & INS_NO_MERGE)) |
1309 | if (op->nrof && !(flag & INS_NO_MERGE)) |