--- deliantra/server/include/object.h 2007/05/07 06:01:48 1.118 +++ deliantra/server/include/object.h 2007/05/12 13:27:37 1.119 @@ -291,6 +291,22 @@ do_remove (); } + // move this object to the top of its env's inventory to speed up + // searches for it. + MTH void inv_splay () + { + if (env && env->inv != this) + { + if (above) above->below = below; + if (below) below->above = above; + + above = 0; + below = env->inv; + below->above = this; + env->inv = this; + } + } + static bool can_merge_slow (object *op1, object *op2); // this is often used in time-critical code, so optimise