Return objptridx_t from obj_create_copy

This commit is contained in:
Kp 2014-01-12 19:14:16 +00:00
parent 599af3e1ba
commit da8e5459d6
2 changed files with 7 additions and 12 deletions

View file

@ -663,7 +663,7 @@ objptridx_t obj_create(enum object_type_t type, ubyte id, int segnum, const vms_
ubyte ctype, ubyte mtype, ubyte rtype);
// make a copy of an object. returs num of new object
int obj_create_copy(int objnum, vms_vector *new_pos, int newsegnum);
objptridx_t obj_create_copy(int objnum, vms_vector *new_pos, int newsegnum);
// remove object from the world
void obj_delete(objptridx_t objnum);

View file

@ -1224,18 +1224,13 @@ objptridx_t obj_create(enum object_type_t type, ubyte id,int segnum,const vms_ve
#ifdef EDITOR
//create a copy of an object. returns new object number
int obj_create_copy(int objnum, vms_vector *new_pos, int newsegnum)
objptridx_t obj_create_copy(int objnum, vms_vector *new_pos, int newsegnum)
{
int newobjnum;
object *obj;
// Find next free object
newobjnum = obj_allocate();
objptridx_t obj = obj_allocate();
if (newobjnum == object_none)
return newobjnum;
obj = &Objects[newobjnum];
if (obj == object_none)
return obj;
*obj = Objects[objnum];
@ -1244,13 +1239,13 @@ int obj_create_copy(int objnum, vms_vector *new_pos, int newsegnum)
obj->next = obj->prev = object_none;
obj->segnum = segment_none;
obj_link(newobjnum,newsegnum);
obj_link(obj,newsegnum);
obj->signature = obj_get_signature();
//we probably should initialize sub-structures here
return newobjnum;
return obj;
}
#endif