… | |
… | |
289 | { |
289 | { |
290 | if (!flag [FLAG_REMOVED]) |
290 | if (!flag [FLAG_REMOVED]) |
291 | do_remove (); |
291 | do_remove (); |
292 | } |
292 | } |
293 | |
293 | |
|
|
294 | // move this object to the top of its env's inventory to speed up |
|
|
295 | // searches for it. |
|
|
296 | MTH void inv_splay () |
|
|
297 | { |
|
|
298 | if (env && env->inv != this) |
|
|
299 | { |
|
|
300 | if (above) above->below = below; |
|
|
301 | if (below) below->above = above; |
|
|
302 | |
|
|
303 | above = 0; |
|
|
304 | below = env->inv; |
|
|
305 | below->above = this; |
|
|
306 | env->inv = this; |
|
|
307 | } |
|
|
308 | } |
|
|
309 | |
294 | static bool can_merge_slow (object *op1, object *op2); |
310 | static bool can_merge_slow (object *op1, object *op2); |
295 | |
311 | |
296 | // this is often used in time-critical code, so optimise |
312 | // this is often used in time-critical code, so optimise |
297 | MTH static bool can_merge (object *op1, object *op2) |
313 | MTH static bool can_merge (object *op1, object *op2) |
298 | { |
314 | { |