mirror of
https://github.com/tbamud/tbamud.git
synced 2026-02-25 13:01:44 +01:00
Allocated Lists merged into one functions for extra expandability
This commit is contained in:
@@ -2370,8 +2370,7 @@ ACMD(do_whois)
|
|||||||
CREATE(victim, struct char_data, 1);
|
CREATE(victim, struct char_data, 1);
|
||||||
clear_char(victim);
|
clear_char(victim);
|
||||||
|
|
||||||
/* Allocate mobile event list */
|
new_mobile_data(victim);
|
||||||
victim->events = create_list();
|
|
||||||
|
|
||||||
CREATE(victim->player_specials, struct player_special_data, 1);
|
CREATE(victim->player_specials, struct player_special_data, 1);
|
||||||
|
|
||||||
|
|||||||
@@ -1009,8 +1009,7 @@ ACMD(do_stat)
|
|||||||
CREATE(victim, struct char_data, 1);
|
CREATE(victim, struct char_data, 1);
|
||||||
clear_char(victim);
|
clear_char(victim);
|
||||||
CREATE(victim->player_specials, struct player_special_data, 1);
|
CREATE(victim->player_specials, struct player_special_data, 1);
|
||||||
/* Allocate mobile event list */
|
new_mobile_data(victim);
|
||||||
victim->events = create_list();
|
|
||||||
if (load_char(buf2, victim) >= 0) {
|
if (load_char(buf2, victim) >= 0) {
|
||||||
char_to_room(victim, 0);
|
char_to_room(victim, 0);
|
||||||
if (GET_LEVEL(victim) > GET_LEVEL(ch))
|
if (GET_LEVEL(victim) > GET_LEVEL(ch))
|
||||||
@@ -2051,8 +2050,7 @@ ACMD(do_last)
|
|||||||
CREATE(vict, struct char_data, 1);
|
CREATE(vict, struct char_data, 1);
|
||||||
clear_char(vict);
|
clear_char(vict);
|
||||||
CREATE(vict->player_specials, struct player_special_data, 1);
|
CREATE(vict->player_specials, struct player_special_data, 1);
|
||||||
/* Allocate mobile event list */
|
new_mobile_data(vict);
|
||||||
vict->events = create_list();
|
|
||||||
if (load_char(name, vict) < 0) {
|
if (load_char(name, vict) < 0) {
|
||||||
send_to_char(ch, "There is no such player.\r\n");
|
send_to_char(ch, "There is no such player.\r\n");
|
||||||
free_char(vict);
|
free_char(vict);
|
||||||
@@ -2571,8 +2569,7 @@ ACMD(do_show)
|
|||||||
CREATE(vict, struct char_data, 1);
|
CREATE(vict, struct char_data, 1);
|
||||||
clear_char(vict);
|
clear_char(vict);
|
||||||
CREATE(vict->player_specials, struct player_special_data, 1);
|
CREATE(vict->player_specials, struct player_special_data, 1);
|
||||||
/* Allocate mobile event list */
|
new_mobile_data(vict);
|
||||||
vict->events = create_list();
|
|
||||||
if (load_char(value, vict) < 0) {
|
if (load_char(value, vict) < 0) {
|
||||||
send_to_char(ch, "There is no such player.\r\n");
|
send_to_char(ch, "There is no such player.\r\n");
|
||||||
free_char(vict);
|
free_char(vict);
|
||||||
@@ -3353,8 +3350,7 @@ ACMD(do_set)
|
|||||||
CREATE(cbuf, struct char_data, 1);
|
CREATE(cbuf, struct char_data, 1);
|
||||||
clear_char(cbuf);
|
clear_char(cbuf);
|
||||||
CREATE(cbuf->player_specials, struct player_special_data, 1);
|
CREATE(cbuf->player_specials, struct player_special_data, 1);
|
||||||
/* Allocate mobile event list */
|
new_mobile_data(cbuf);
|
||||||
cbuf->events = create_list();
|
|
||||||
if ((player_i = load_char(name, cbuf)) > -1) {
|
if ((player_i = load_char(name, cbuf)) > -1) {
|
||||||
if (GET_LEVEL(cbuf) > GET_LEVEL(ch)) {
|
if (GET_LEVEL(cbuf) > GET_LEVEL(ch)) {
|
||||||
free_char(cbuf);
|
free_char(cbuf);
|
||||||
@@ -4621,8 +4617,7 @@ bool change_player_name(struct char_data *ch, struct char_data *vict, char *new_
|
|||||||
CREATE(temp_ch, struct char_data, 1);
|
CREATE(temp_ch, struct char_data, 1);
|
||||||
clear_char(temp_ch);
|
clear_char(temp_ch);
|
||||||
CREATE(temp_ch->player_specials, struct player_special_data, 1);
|
CREATE(temp_ch->player_specials, struct player_special_data, 1);
|
||||||
/* Allocate mobile event list */
|
new_mobile_data(temp_ch);
|
||||||
temp_ch->events = create_list();
|
|
||||||
if ((plr_i = load_char(new_name, temp_ch)) > -1) {
|
if ((plr_i = load_char(new_name, temp_ch)) > -1) {
|
||||||
free_char(temp_ch);
|
free_char(temp_ch);
|
||||||
send_to_char(ch, "Sorry, the new name already exists.\r\n");
|
send_to_char(ch, "Sorry, the new name already exists.\r\n");
|
||||||
|
|||||||
@@ -450,8 +450,7 @@ void copyover_recover()
|
|||||||
clear_char(d->character);
|
clear_char(d->character);
|
||||||
CREATE(d->character->player_specials, struct player_special_data, 1);
|
CREATE(d->character->player_specials, struct player_special_data, 1);
|
||||||
|
|
||||||
/* Allocate mobile event list */
|
new_mobile_data(d->character);
|
||||||
d->character->events = create_list();
|
|
||||||
|
|
||||||
d->character->desc = d;
|
d->character->desc = d;
|
||||||
|
|
||||||
|
|||||||
12
src/db.c
12
src/db.c
@@ -2322,8 +2322,7 @@ struct char_data *create_char(void)
|
|||||||
CREATE(ch, struct char_data, 1);
|
CREATE(ch, struct char_data, 1);
|
||||||
clear_char(ch);
|
clear_char(ch);
|
||||||
|
|
||||||
/* Allocate mobile event list */
|
new_mobile_data(ch);
|
||||||
ch->events = create_list();
|
|
||||||
|
|
||||||
ch->next = character_list;
|
ch->next = character_list;
|
||||||
character_list = ch;
|
character_list = ch;
|
||||||
@@ -2335,6 +2334,12 @@ struct char_data *create_char(void)
|
|||||||
return (ch);
|
return (ch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void new_mobile_data(struct char_data *ch)
|
||||||
|
{
|
||||||
|
ch->events = create_list();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* create a new mobile from a prototype */
|
/* create a new mobile from a prototype */
|
||||||
struct char_data *read_mobile(mob_vnum nr, int type) /* and mob_rnum */
|
struct char_data *read_mobile(mob_vnum nr, int type) /* and mob_rnum */
|
||||||
{
|
{
|
||||||
@@ -2356,8 +2361,7 @@ struct char_data *read_mobile(mob_vnum nr, int type) /* and mob_rnum */
|
|||||||
mob->next = character_list;
|
mob->next = character_list;
|
||||||
character_list = mob;
|
character_list = mob;
|
||||||
|
|
||||||
/* Allocate mobile event list */
|
new_mobile_data(mob);
|
||||||
mob->events = create_list();
|
|
||||||
|
|
||||||
if (!mob->points.max_hit) {
|
if (!mob->points.max_hit) {
|
||||||
mob->points.max_hit = dice(mob->points.hit, mob->points.mana) +
|
mob->points.max_hit = dice(mob->points.hit, mob->points.mana) +
|
||||||
|
|||||||
1
src/db.h
1
src/db.h
@@ -256,6 +256,7 @@ void free_text_files(void);
|
|||||||
void free_help_table(void);
|
void free_help_table(void);
|
||||||
void free_player_index(void);
|
void free_player_index(void);
|
||||||
void load_help(FILE *fl, char *name);
|
void load_help(FILE *fl, char *name);
|
||||||
|
void new_mobile_data(struct char_data *ch);
|
||||||
|
|
||||||
zone_rnum real_zone(zone_vnum vnum);
|
zone_rnum real_zone(zone_vnum vnum);
|
||||||
room_rnum real_room(room_vnum vnum);
|
room_rnum real_room(room_vnum vnum);
|
||||||
|
|||||||
@@ -1354,8 +1354,7 @@ void nanny(struct descriptor_data *d, char *arg)
|
|||||||
clear_char(d->character);
|
clear_char(d->character);
|
||||||
CREATE(d->character->player_specials, struct player_special_data, 1);
|
CREATE(d->character->player_specials, struct player_special_data, 1);
|
||||||
|
|
||||||
/* Allocate mobile event list */
|
new_mobile_data(d->character);
|
||||||
d->character->events = create_list();
|
|
||||||
|
|
||||||
GET_HOST(d->character) = strdup(d->host);
|
GET_HOST(d->character) = strdup(d->host);
|
||||||
d->character->desc = d;
|
d->character->desc = d;
|
||||||
@@ -1392,8 +1391,7 @@ void nanny(struct descriptor_data *d, char *arg)
|
|||||||
clear_char(d->character);
|
clear_char(d->character);
|
||||||
CREATE(d->character->player_specials, struct player_special_data, 1);
|
CREATE(d->character->player_specials, struct player_special_data, 1);
|
||||||
|
|
||||||
/* Allocate mobile event list */
|
new_mobile_data(d->character);
|
||||||
d->character->events = create_list();
|
|
||||||
|
|
||||||
if (GET_HOST(d->character))
|
if (GET_HOST(d->character))
|
||||||
free(GET_HOST(d->character));
|
free(GET_HOST(d->character));
|
||||||
|
|||||||
Reference in New Issue
Block a user