aboutsummaryrefslogtreecommitdiff
path: root/src/room.c
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2016-05-19 16:47:06 -0400
committerFranklin Wei <git@fwei.tk>2016-05-19 16:47:06 -0400
commitcb8af6e7bf5f6e70fc9722d36448213c719e83c8 (patch)
treeec9f93d6e1256d62a49fb628d8d7a3a931b58330 /src/room.c
parent7f3ba14388a586a946d721a71eb3a9862f7f6c02 (diff)
downloadnetcosm-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.c14
1 files changed, 13 insertions, 1 deletions
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))