From 47f7ad955f7d80eab9a29712c0ab274ca7d59071 Mon Sep 17 00:00:00 2001 From: Vatiken Date: Mon, 20 Feb 2012 20:25:24 +0000 Subject: [PATCH] Minor adjustments, and small 10 Dir bug fix --- src/act.movement.c | 2 +- src/interpreter.c | 80 +++++++++++++++++++++++++--------------------- src/lists.h | 2 +- src/mud_event.c | 41 +++++++++++------------- 4 files changed, 63 insertions(+), 62 deletions(-) diff --git a/src/act.movement.c b/src/act.movement.c index dbcac13..58f0088 100644 --- a/src/act.movement.c +++ b/src/act.movement.c @@ -342,7 +342,7 @@ int perform_move(struct char_data *ch, int dir, int need_specials_check) room_rnum was_in; struct follow_type *k, *next; - if (ch == NULL || dir < 0 || dir >= DIR_COUNT || FIGHTING(ch)) + if (ch == NULL || dir < 0 || dir >= NUM_OF_DIRS || FIGHTING(ch)) return (0); else if (!CONFIG_DIAGONAL_DIRS && IS_DIAGONAL(dir)) send_to_char(ch, "Alas, you cannot go that way...\r\n"); diff --git a/src/interpreter.c b/src/interpreter.c index 3d66755..0e22740 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -72,14 +72,20 @@ cpp_extern const struct command_info cmd_info[] = { { "west" , "w" , POS_STANDING, do_move , 0, SCMD_WEST }, { "up" , "u" , POS_STANDING, do_move , 0, SCMD_UP }, { "down" , "d" , POS_STANDING, do_move , 0, SCMD_DOWN }, - { "northwest", "northw" , POS_STANDING, do_move , 0, SCMD_NW }, - { "nw" , "nw" , POS_STANDING, do_move , 0, SCMD_NW }, - { "northeast", "northe" , POS_STANDING, do_move , 0, SCMD_NE }, - { "ne" , "ne" , POS_STANDING, do_move , 0, SCMD_NE }, - { "southeast", "southe" , POS_STANDING, do_move , 0, SCMD_SE }, - { "se" , "se" , POS_STANDING, do_move , 0, SCMD_SE }, - { "southwest", "southw" , POS_STANDING, do_move , 0, SCMD_SW }, - { "sw" , "sw" , POS_STANDING, do_move , 0, SCMD_SW }, + { "north" , "n" , POS_STANDING, do_move , 0, SCMD_NORTH }, + { "east" , "e" , POS_STANDING, do_move , 0, SCMD_EAST }, + { "south" , "s" , POS_STANDING, do_move , 0, SCMD_SOUTH }, + { "west" , "w" , POS_STANDING, do_move , 0, SCMD_WEST }, + { "up" , "u" , POS_STANDING, do_move , 0, SCMD_UP }, + { "down" , "d" , POS_STANDING, do_move , 0, SCMD_DOWN }, + { "northwest", "northw" , POS_STANDING, do_move , 0, SCMD_NW }, + { "nw" , "nw" , POS_STANDING, do_move , 0, SCMD_NW }, + { "northeast", "northe" , POS_STANDING, do_move , 0, SCMD_NE }, + { "ne" , "ne" , POS_STANDING, do_move , 0, SCMD_NE }, + { "southeast", "southe" , POS_STANDING, do_move , 0, SCMD_SE }, + { "se" , "se" , POS_STANDING, do_move , 0, SCMD_SE }, + { "southwest", "southw" , POS_STANDING, do_move , 0, SCMD_SW }, + { "sw" , "sw" , POS_STANDING, do_move , 0, SCMD_SW }, /* now, the main list */ { "at" , "at" , POS_DEAD , do_at , LVL_IMMORT, 0 }, @@ -1222,51 +1228,51 @@ static bool perform_new_char_dupe_check(struct descriptor_data *d) /* load the player, put them in the right room - used by copyover_recover too */ int enter_player_game (struct descriptor_data *d) { - int load_result; - room_vnum load_room; + int load_result; + room_vnum load_room; - reset_char(d->character); + reset_char(d->character); - if (PLR_FLAGGED(d->character, PLR_INVSTART)) - GET_INVIS_LEV(d->character) = GET_LEVEL(d->character); + if (PLR_FLAGGED(d->character, PLR_INVSTART)) + GET_INVIS_LEV(d->character) = GET_LEVEL(d->character); - /* We have to place the character in a room before equipping them - * or equip_char() will gripe about the person in NOWHERE. */ - if ((load_room = GET_LOADROOM(d->character)) != NOWHERE) + /* We have to place the character in a room before equipping them + * or equip_char() will gripe about the person in NOWHERE. */ + if ((load_room = GET_LOADROOM(d->character)) != NOWHERE) load_room = real_room(load_room); - /* If char was saved with NOWHERE, or real_room above failed... */ - if (load_room == NOWHERE) { + /* If char was saved with NOWHERE, or real_room above failed... */ + if (load_room == NOWHERE) { if (GET_LEVEL(d->character) >= LVL_IMMORT) load_room = r_immort_start_room; else load_room = r_mortal_start_room; - } + } - if (PLR_FLAGGED(d->character, PLR_FROZEN)) + if (PLR_FLAGGED(d->character, PLR_FROZEN)) load_room = r_frozen_start_room; - /* copyover */ - GET_ID(d->character) = GET_IDNUM(d->character); - /* find_char helper */ - add_to_lookup_table(GET_ID(d->character), (void *)d->character); + /* copyover */ + GET_ID(d->character) = GET_IDNUM(d->character); + /* find_char helper */ + add_to_lookup_table(GET_ID(d->character), (void *)d->character); - /* After moving saving of variables to the player file, this should only - * be called in case nothing was found in the pfile. If something was - * found, SCRIPT(ch) will be set. */ - if (!SCRIPT(d->character)) - read_saved_vars(d->character); + /* After moving saving of variables to the player file, this should only + * be called in case nothing was found in the pfile. If something was + * found, SCRIPT(ch) will be set. */ + if (!SCRIPT(d->character)) + read_saved_vars(d->character); - d->character->next = character_list; - character_list = d->character; - char_to_room(d->character, load_room); - load_result = Crash_load(d->character); - save_char(d->character); + d->character->next = character_list; + character_list = d->character; + char_to_room(d->character, load_room); + load_result = Crash_load(d->character); + save_char(d->character); - /* Check for a login trigger in the players' start room */ - login_wtrigger(&world[IN_ROOM(d->character)], d->character); + /* Check for a login trigger in the players' start room */ + login_wtrigger(&world[IN_ROOM(d->character)], d->character); - return load_result; + return load_result; } EVENTFUNC(get_protocols) diff --git a/src/lists.h b/src/lists.h index 44991a2..b7fd7fb 100644 --- a/src/lists.h +++ b/src/lists.h @@ -34,7 +34,7 @@ struct iterator_data { /* Externals */ extern struct list_data * global_lists; extern struct list_data * ticker_list; -extern int total_lists; + /* Locals */ void add_to_list(void * pContent, struct list_data * pList); void * random_from_list(struct list_data * pList); diff --git a/src/mud_event.c b/src/mud_event.c index 48312d6..a92012b 100644 --- a/src/mud_event.c +++ b/src/mud_event.c @@ -19,8 +19,8 @@ struct list_data * world_events = NULL; struct mud_event_list mud_event_index[] = { - { "Null" , NULL , -1 }, /* eNULL */ - { "Protocol" , get_protocols, EVENT_DESC } /* ePROTOCOLS */ + { "Null" , NULL , -1 }, /* eNULL */ + { "Protocol" , get_protocols, EVENT_DESC } /* ePROTOCOLS */ }; void init_events(void) @@ -31,26 +31,26 @@ void init_events(void) EVENTFUNC(event_countdown) { - struct mud_event_data * pMudEvent; - struct char_data * ch = NULL; + struct mud_event_data * pMudEvent; + struct char_data * ch = NULL; - pMudEvent = (struct mud_event_data * ) event_obj; + pMudEvent = (struct mud_event_data * ) event_obj; - switch (mud_event_index[pMudEvent->iId].iEvent_Type) { - case EVENT_CHAR: - ch = (struct char_data * ) pMudEvent->pStruct; - break; - default: - break; - } + switch (mud_event_index[pMudEvent->iId].iEvent_Type) { + case EVENT_CHAR: + ch = (struct char_data * ) pMudEvent->pStruct; + break; + default: + break; + } - switch (pMudEvent->iId) { - default: - break; - } + switch (pMudEvent->iId) { + default: + break; + } - free_mud_event(pMudEvent); - return 0; + free_mud_event(pMudEvent); + return 0; } void attach_mud_event(struct mud_event_data *pMudEvent, long time) @@ -66,17 +66,14 @@ void attach_mud_event(struct mud_event_data *pMudEvent, long time) switch (mud_event_index[pMudEvent->iId].iEvent_Type) { case EVENT_WORLD: add_to_list(pEvent, world_events); - mudlog(CMP, LVL_GRGOD, TRUE, "INFO: Mud Event '%s' added to world", mud_event_index[pMudEvent->iId].event_name); break; case EVENT_DESC: d = (struct descriptor_data *) pMudEvent->pStruct; add_to_list(pEvent, d->events); - mudlog(CMP, LVL_GRGOD, TRUE, "INFO: Mud Event '%s' added to %s", mud_event_index[pMudEvent->iId].event_name, d->host ? d->host : "descriptor"); break; case EVENT_CHAR: ch = (struct char_data *) pMudEvent->pStruct; add_to_list(pEvent, ch->events); - mudlog(CMP, LVL_GRGOD, TRUE, "INFO: Mud Event '%s' added to %s", mud_event_index[pMudEvent->iId].event_name, GET_NAME(ch)); break; } } @@ -102,8 +99,6 @@ void free_mud_event(struct mud_event_data *pMudEvent) struct descriptor_data * d; struct char_data * ch; - mudlog(CMP, LVL_GRGOD, TRUE, "INFO: Freeing mud event '%s' : %d", mud_event_index[pMudEvent->iId].event_name, pMudEvent->iId); - switch (mud_event_index[pMudEvent->iId].iEvent_Type) { case EVENT_WORLD: remove_from_list(pMudEvent->pEvent, world_events);