… | |
… | |
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"); |