… | |
… | |
746 | * UP_OBJ_FACE: only the objects face has changed. |
746 | * UP_OBJ_FACE: only the objects face has changed. |
747 | */ |
747 | */ |
748 | void |
748 | void |
749 | update_object (object *op, int action) |
749 | update_object (object *op, int action) |
750 | { |
750 | { |
751 | if (op == NULL) |
751 | if (!op) |
752 | { |
752 | { |
753 | /* this should never happen */ |
753 | /* this should never happen */ |
754 | LOG (llevDebug, "update_object() called for NULL object.\n"); |
754 | LOG (llevError | logBacktrace, "update_object() called for NULL object.\n"); |
755 | return; |
755 | return; |
756 | } |
756 | } |
757 | |
757 | |
758 | if (op->env) |
758 | if (!op->is_on_map ()) |
759 | { |
759 | { |
760 | /* Animation is currently handled by client, so nothing |
760 | /* Animation is currently handled by client, so nothing |
761 | * to do in this case. |
761 | * to do in this case. |
762 | */ |
762 | */ |
763 | return; |
763 | return; |
764 | } |
764 | } |
765 | |
|
|
766 | /* If the map is saving, don't do anything as everything is |
|
|
767 | * going to get freed anyways. |
|
|
768 | */ |
|
|
769 | if (!op->map || op->map->in_memory == MAP_SAVING) |
|
|
770 | return; |
|
|
771 | |
765 | |
772 | /* make sure the object is within map boundaries */ |
766 | /* make sure the object is within map boundaries */ |
773 | if (op->x < 0 || op->x >= op->map->width || op->y < 0 || op->y >= op->map->height) |
767 | if (op->x < 0 || op->x >= op->map->width || op->y < 0 || op->y >= op->map->height) |
774 | { |
768 | { |
775 | LOG (llevError, "update_object() called for object out of map!\n"); |
769 | LOG (llevError, "update_object() called for object out of map!\n"); |
… | |
… | |
1073 | * In this case, the object to be removed is in someones |
1067 | * In this case, the object to be removed is in someones |
1074 | * inventory. |
1068 | * inventory. |
1075 | */ |
1069 | */ |
1076 | if (env) |
1070 | if (env) |
1077 | { |
1071 | { |
|
|
1072 | flag [FLAG_REMOVED] = false; // hack around the issue of visible_to checking flag_removed |
1078 | if (object *pl = visible_to ()) |
1073 | if (object *pl = visible_to ()) |
1079 | esrv_del_item (pl->contr, count); |
1074 | esrv_del_item (pl->contr, count); |
|
|
1075 | flag [FLAG_REMOVED] = true; // hack around the issue of visible_to checking flag_removed |
1080 | |
1076 | |
1081 | adjust_weight (env, -total_weight ()); |
1077 | adjust_weight (env, -total_weight ()); |
1082 | |
1078 | |
1083 | *(above ? &above->below : &env->inv) = below; |
1079 | *(above ? &above->below : &env->inv) = below; |
1084 | |
1080 | |