diff options
| author | Franklin Wei <git@fwei.tk> | 2016-05-19 16:47:06 -0400 |
|---|---|---|
| committer | Franklin Wei <git@fwei.tk> | 2016-05-19 16:47:06 -0400 |
| commit | cb8af6e7bf5f6e70fc9722d36448213c719e83c8 (patch) | |
| tree | ec9f93d6e1256d62a49fb628d8d7a3a931b58330 /src/room.c | |
| parent | 7f3ba14388a586a946d721a71eb3a9862f7f6c02 (diff) | |
| download | netcosm-cb8af6e7bf5f6e70fc9722d36448213c719e83c8.zip netcosm-cb8af6e7bf5f6e70fc9722d36448213c719e83c8.tar.gz netcosm-cb8af6e7bf5f6e70fc9722d36448213c719e83c8.tar.bz2 netcosm-cb8af6e7bf5f6e70fc9722d36448213c719e83c8.tar.xz | |
implement more of dunnet
Diffstat (limited to 'src/room.c')
| -rw-r--r-- | src/room.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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)) |