mirror of
https://github.com/tbamud/tbamud.git
synced 2026-02-28 22:41:44 +01:00
Minor adjustments, and small 10 Dir bug fix
This commit is contained in:
@@ -342,7 +342,7 @@ int perform_move(struct char_data *ch, int dir, int need_specials_check)
|
|||||||
room_rnum was_in;
|
room_rnum was_in;
|
||||||
struct follow_type *k, *next;
|
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);
|
return (0);
|
||||||
else if (!CONFIG_DIAGONAL_DIRS && IS_DIAGONAL(dir))
|
else if (!CONFIG_DIAGONAL_DIRS && IS_DIAGONAL(dir))
|
||||||
send_to_char(ch, "Alas, you cannot go that way...\r\n");
|
send_to_char(ch, "Alas, you cannot go that way...\r\n");
|
||||||
|
|||||||
@@ -72,14 +72,20 @@ cpp_extern const struct command_info cmd_info[] = {
|
|||||||
{ "west" , "w" , POS_STANDING, do_move , 0, SCMD_WEST },
|
{ "west" , "w" , POS_STANDING, do_move , 0, SCMD_WEST },
|
||||||
{ "up" , "u" , POS_STANDING, do_move , 0, SCMD_UP },
|
{ "up" , "u" , POS_STANDING, do_move , 0, SCMD_UP },
|
||||||
{ "down" , "d" , POS_STANDING, do_move , 0, SCMD_DOWN },
|
{ "down" , "d" , POS_STANDING, do_move , 0, SCMD_DOWN },
|
||||||
{ "northwest", "northw" , POS_STANDING, do_move , 0, SCMD_NW },
|
{ "north" , "n" , POS_STANDING, do_move , 0, SCMD_NORTH },
|
||||||
{ "nw" , "nw" , POS_STANDING, do_move , 0, SCMD_NW },
|
{ "east" , "e" , POS_STANDING, do_move , 0, SCMD_EAST },
|
||||||
{ "northeast", "northe" , POS_STANDING, do_move , 0, SCMD_NE },
|
{ "south" , "s" , POS_STANDING, do_move , 0, SCMD_SOUTH },
|
||||||
{ "ne" , "ne" , POS_STANDING, do_move , 0, SCMD_NE },
|
{ "west" , "w" , POS_STANDING, do_move , 0, SCMD_WEST },
|
||||||
{ "southeast", "southe" , POS_STANDING, do_move , 0, SCMD_SE },
|
{ "up" , "u" , POS_STANDING, do_move , 0, SCMD_UP },
|
||||||
{ "se" , "se" , POS_STANDING, do_move , 0, SCMD_SE },
|
{ "down" , "d" , POS_STANDING, do_move , 0, SCMD_DOWN },
|
||||||
{ "southwest", "southw" , POS_STANDING, do_move , 0, SCMD_SW },
|
{ "northwest", "northw" , POS_STANDING, do_move , 0, SCMD_NW },
|
||||||
{ "sw" , "sw" , POS_STANDING, do_move , 0, SCMD_SW },
|
{ "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 */
|
/* now, the main list */
|
||||||
{ "at" , "at" , POS_DEAD , do_at , LVL_IMMORT, 0 },
|
{ "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 */
|
/* load the player, put them in the right room - used by copyover_recover too */
|
||||||
int enter_player_game (struct descriptor_data *d)
|
int enter_player_game (struct descriptor_data *d)
|
||||||
{
|
{
|
||||||
int load_result;
|
int load_result;
|
||||||
room_vnum load_room;
|
room_vnum load_room;
|
||||||
|
|
||||||
reset_char(d->character);
|
reset_char(d->character);
|
||||||
|
|
||||||
if (PLR_FLAGGED(d->character, PLR_INVSTART))
|
if (PLR_FLAGGED(d->character, PLR_INVSTART))
|
||||||
GET_INVIS_LEV(d->character) = GET_LEVEL(d->character);
|
GET_INVIS_LEV(d->character) = GET_LEVEL(d->character);
|
||||||
|
|
||||||
/* We have to place the character in a room before equipping them
|
/* We have to place the character in a room before equipping them
|
||||||
* or equip_char() will gripe about the person in NOWHERE. */
|
* or equip_char() will gripe about the person in NOWHERE. */
|
||||||
if ((load_room = GET_LOADROOM(d->character)) != NOWHERE)
|
if ((load_room = GET_LOADROOM(d->character)) != NOWHERE)
|
||||||
load_room = real_room(load_room);
|
load_room = real_room(load_room);
|
||||||
|
|
||||||
/* If char was saved with NOWHERE, or real_room above failed... */
|
/* If char was saved with NOWHERE, or real_room above failed... */
|
||||||
if (load_room == NOWHERE) {
|
if (load_room == NOWHERE) {
|
||||||
if (GET_LEVEL(d->character) >= LVL_IMMORT)
|
if (GET_LEVEL(d->character) >= LVL_IMMORT)
|
||||||
load_room = r_immort_start_room;
|
load_room = r_immort_start_room;
|
||||||
else
|
else
|
||||||
load_room = r_mortal_start_room;
|
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;
|
load_room = r_frozen_start_room;
|
||||||
|
|
||||||
/* copyover */
|
/* copyover */
|
||||||
GET_ID(d->character) = GET_IDNUM(d->character);
|
GET_ID(d->character) = GET_IDNUM(d->character);
|
||||||
/* find_char helper */
|
/* find_char helper */
|
||||||
add_to_lookup_table(GET_ID(d->character), (void *)d->character);
|
add_to_lookup_table(GET_ID(d->character), (void *)d->character);
|
||||||
|
|
||||||
/* After moving saving of variables to the player file, this should only
|
/* 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
|
* be called in case nothing was found in the pfile. If something was
|
||||||
* found, SCRIPT(ch) will be set. */
|
* found, SCRIPT(ch) will be set. */
|
||||||
if (!SCRIPT(d->character))
|
if (!SCRIPT(d->character))
|
||||||
read_saved_vars(d->character);
|
read_saved_vars(d->character);
|
||||||
|
|
||||||
d->character->next = character_list;
|
d->character->next = character_list;
|
||||||
character_list = d->character;
|
character_list = d->character;
|
||||||
char_to_room(d->character, load_room);
|
char_to_room(d->character, load_room);
|
||||||
load_result = Crash_load(d->character);
|
load_result = Crash_load(d->character);
|
||||||
save_char(d->character);
|
save_char(d->character);
|
||||||
|
|
||||||
/* Check for a login trigger in the players' start room */
|
/* Check for a login trigger in the players' start room */
|
||||||
login_wtrigger(&world[IN_ROOM(d->character)], d->character);
|
login_wtrigger(&world[IN_ROOM(d->character)], d->character);
|
||||||
|
|
||||||
return load_result;
|
return load_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
EVENTFUNC(get_protocols)
|
EVENTFUNC(get_protocols)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ struct iterator_data {
|
|||||||
/* Externals */
|
/* Externals */
|
||||||
extern struct list_data * global_lists;
|
extern struct list_data * global_lists;
|
||||||
extern struct list_data * ticker_list;
|
extern struct list_data * ticker_list;
|
||||||
extern int total_lists;
|
|
||||||
/* Locals */
|
/* Locals */
|
||||||
void add_to_list(void * pContent, struct list_data * pList);
|
void add_to_list(void * pContent, struct list_data * pList);
|
||||||
void * random_from_list(struct list_data * pList);
|
void * random_from_list(struct list_data * pList);
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
struct list_data * world_events = NULL;
|
struct list_data * world_events = NULL;
|
||||||
|
|
||||||
struct mud_event_list mud_event_index[] = {
|
struct mud_event_list mud_event_index[] = {
|
||||||
{ "Null" , NULL , -1 }, /* eNULL */
|
{ "Null" , NULL , -1 }, /* eNULL */
|
||||||
{ "Protocol" , get_protocols, EVENT_DESC } /* ePROTOCOLS */
|
{ "Protocol" , get_protocols, EVENT_DESC } /* ePROTOCOLS */
|
||||||
};
|
};
|
||||||
|
|
||||||
void init_events(void)
|
void init_events(void)
|
||||||
@@ -31,26 +31,26 @@ void init_events(void)
|
|||||||
|
|
||||||
EVENTFUNC(event_countdown)
|
EVENTFUNC(event_countdown)
|
||||||
{
|
{
|
||||||
struct mud_event_data * pMudEvent;
|
struct mud_event_data * pMudEvent;
|
||||||
struct char_data * ch = NULL;
|
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) {
|
switch (mud_event_index[pMudEvent->iId].iEvent_Type) {
|
||||||
case EVENT_CHAR:
|
case EVENT_CHAR:
|
||||||
ch = (struct char_data * ) pMudEvent->pStruct;
|
ch = (struct char_data * ) pMudEvent->pStruct;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (pMudEvent->iId) {
|
switch (pMudEvent->iId) {
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
free_mud_event(pMudEvent);
|
free_mud_event(pMudEvent);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void attach_mud_event(struct mud_event_data *pMudEvent, long time)
|
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) {
|
switch (mud_event_index[pMudEvent->iId].iEvent_Type) {
|
||||||
case EVENT_WORLD:
|
case EVENT_WORLD:
|
||||||
add_to_list(pEvent, world_events);
|
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;
|
break;
|
||||||
case EVENT_DESC:
|
case EVENT_DESC:
|
||||||
d = (struct descriptor_data *) pMudEvent->pStruct;
|
d = (struct descriptor_data *) pMudEvent->pStruct;
|
||||||
add_to_list(pEvent, d->events);
|
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;
|
break;
|
||||||
case EVENT_CHAR:
|
case EVENT_CHAR:
|
||||||
ch = (struct char_data *) pMudEvent->pStruct;
|
ch = (struct char_data *) pMudEvent->pStruct;
|
||||||
add_to_list(pEvent, ch->events);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,8 +99,6 @@ void free_mud_event(struct mud_event_data *pMudEvent)
|
|||||||
struct descriptor_data * d;
|
struct descriptor_data * d;
|
||||||
struct char_data * ch;
|
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) {
|
switch (mud_event_index[pMudEvent->iId].iEvent_Type) {
|
||||||
case EVENT_WORLD:
|
case EVENT_WORLD:
|
||||||
remove_from_list(pMudEvent->pEvent, world_events);
|
remove_from_list(pMudEvent->pEvent, world_events);
|
||||||
|
|||||||
Reference in New Issue
Block a user