From cb8af6e7bf5f6e70fc9722d36448213c719e83c8 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Thu, 19 May 2016 16:47:06 -0400 Subject: implement more of dunnet --- src/room.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/room.c') diff --git a/src/room.c b/src/room.c index 2e7688a..19a4b73 100644 --- a/src/room.c +++ b/src/room.c @@ -25,6 +25,8 @@ #include "userdb.h" #include "world.h" +/* these do not perform hook checking on the requested action, that is + * the responsibility of the caller */ bool room_user_add(room_id id, struct child_data *child) { struct room_t *room = room_get(id); @@ -60,6 +62,16 @@ bool room_user_del(room_id id, struct child_data *child) return false; } +/* ignores hooks */ +void room_user_teleport(struct child_data *child, room_id id) +{ + if(child->room != id) + { + room_user_del(child->room, child); + room_user_add(id, child); + } +} + void room_free(struct room_t *room) { if(room->data.hook_destroy) @@ -99,7 +111,7 @@ bool room_obj_add(room_id room, struct object_t *obj) return status; } -bool room_obj_add_alias(room_id room, struct object_t *obj, char *alias) +bool room_obj_add_alias(room_id room, struct object_t *obj, const char *alias) { /* the primary name must be added */ if(!room_obj_get(room, obj->name)) -- cgit v1.1