--- deliantra/server/server/time.C 2009/11/29 09:41:28 1.100 +++ deliantra/server/server/time.C 2009/11/29 17:26:28 1.101 @@ -829,8 +829,6 @@ static void change_object (object *op) { /* Doesn`t handle linked objs yet */ - int i, j; - if (!op->other_arch) { LOG (llevError, "Change object (%s) without other_arch error.\n", op->debug_desc ()); @@ -849,9 +847,9 @@ object *env = op->env; op->remove (); - for (i = 0; i < op->stats.food; i++) + for (int i = 0; i < op->stats.food; i++) { - object *tmp = arch_to_object (op->other_arch); + object *tmp = op->other_arch->instance (); tmp->stats.hp = op->stats.hp; /* The only variable it keeps. */ @@ -859,7 +857,8 @@ env->insert (tmp); else { - j = find_first_free_spot (tmp, op->map, op->x, op->y); + int j = find_first_free_spot (tmp, op->map, op->x, op->y); + if (j < 0) /* No free spot */ tmp->destroy (); else