Keeping in mind that my memory of the CWG vehicle system is a little rusty at best, if I do remember correctly, the system worked by having an OBJ, that had a vnum set to it that allowed someone to use it as a door to the vehicle room. From there, you'd use a WINDOW object, or a CONTROL type object to navigate the vehicle around the world.
My suggestion was far simpler then what you have scribed up. Essentially what would happen is when a vehicle object is loaded into the MUD, we'll call on a function like find_available_vehicle_room(), and change the vehicle object's vnum to that room. You could also then flag the room ROOM_OCCUPIED or something so we know it's in use. If you wanted to go further, you could keep some data stored on the player which you could use to alter the room name, description etc.. When the player quits, remove his vehicle (or decommission it), and unOCCUPY the room.
From your example, you have a few issues.
Code:
room_to_copy = &world[(GET_OBJ_VAL_0(obj))];
This implies that you are storing the room RNUM in OBJ_VAL(), which SHOULD be incorrect as RNUM change as new rooms are added/removed.
Code:
void new_dynamic_room(struct room_data *copied_room)
{
struct room_data *new_room;
room_rnum new_roomnum;
CREATE(new_room, struct room_data, 1);
copy_room(new_room, copied_room);
new_room->number = find_next_available_vnum();
new_roomnum = add_room(new_room);
}
There really is no need for any of this as the room is already created, it's just a matter of placing in it the player, and other necessary objects, and renaming/re-describing it (if neccessary).
What I'd REALLY like to do is convert tbamud to a vnumless system, however time is getting more sparse as I age.
This would be like trying to turn a printer into a toaster... it could be done but there are MUCH easier ways to make a toaster. Switching to a non-vnum system in tbaMUD would require re-doing a (!EPIC!) SIGNIFICANT (!EPIC!) percentage of the code, as so much is tied into vnums and rnums.