mirror of
https://github.com/tbamud/tbamud.git
synced 2026-01-04 00:18:49 +01:00
Minor adjustments, and small 10 Dir bug fix
This commit is contained in:
parent
ad3bb8bc64
commit
47f7ad955f
4 changed files with 63 additions and 62 deletions
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue