From a0ac77569bda491360c90d3e7e30ff0669a466c6 Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 11 Jan 2014 17:14:20 +0000 Subject: [PATCH] Pass objptridx_t to obj_delete --- common/main/object.h | 2 +- similar/main/object.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/common/main/object.h b/common/main/object.h index df5019d51..075fd2004 100644 --- a/common/main/object.h +++ b/common/main/object.h @@ -664,7 +664,7 @@ objptridx_t obj_create(enum object_type_t type, ubyte id, int segnum, const vms_ int obj_create_copy(int objnum, vms_vector *new_pos, int newsegnum); // remove object from the world -void obj_delete(int objnum); +void obj_delete(objptridx_t objnum); // called after load. Takes number of objects, and objects should be // compressed diff --git a/similar/main/object.cpp b/similar/main/object.cpp index d5b90f27c..2d720c9f9 100644 --- a/similar/main/object.cpp +++ b/similar/main/object.cpp @@ -1256,10 +1256,9 @@ int obj_create_copy(int objnum, vms_vector *new_pos, int newsegnum) #endif //remove object from the world -void obj_delete(int objnum) +void obj_delete(objptridx_t obj) { - Assert(objnum != object_none); - object *obj = &Objects[objnum]; + Assert(obj != object_none); Assert(obj->type != OBJ_NONE); Assert(obj != ConsoleObject); @@ -1289,14 +1288,14 @@ void obj_delete(int objnum) if (obj->type == OBJ_DEBRIS) Debris_object_count--; - obj_unlink(objnum); + obj_unlink(obj); Assert(Objects[0].next != 0); obj->type = OBJ_NONE; //unused! obj->signature = -1; - obj_free(objnum); + obj_free(obj); } #define DEATH_SEQUENCE_LENGTH (F1_0*5)