mirror of
https://github.com/tbamud/tbamud.git
synced 2025-12-17 15:50:14 +01:00
[Jan 24 2009] - Rumble
Fixed command queue cancelling "--" from cancelling the next command. (thanks Fren ze/Ogdin) Fixed object timer values from not saving. (thanks Stoneheart) Fixed latest GCC warnings in the /utils. (thanks Jamdog) Fixed violent area spells so they would not harm group members. (thanks Nhilar) Changed usage of qm->nr to GET_MOB_VNUM(qm). (thanks Tails)
This commit is contained in:
parent
b458c58878
commit
c9c7ed9e7a
11 changed files with 41 additions and 26 deletions
|
|
@ -35,6 +35,12 @@ export (QQ's a zone into a tarball)t
|
|||
Xlist (mlist, olist, rlist, zlist, slist, tlist, qlist)
|
||||
(lots of major bugfixes too)
|
||||
tbaMUD 3.59
|
||||
[Jan 24 2009] - Rumble
|
||||
Fixed command queue cancelling "--" from cancelling the next command. (thanks Frenze/Ogdin)
|
||||
Fixed object timer values from not saving. (thanks Stoneheart)
|
||||
Fixed latest GCC warnings in the /utils. (thanks Jamdog)
|
||||
Fixed violent area spells so they would not harm group members. (thanks Nhilar)
|
||||
Changed usage of qm->nr to GET_MOB_VNUM(qm). (thanks Tails)
|
||||
[Jan 21 2009] - Jamdog
|
||||
Added trigedit variable %move% to teleport objects.
|
||||
Fixed memory leak in generic_complete_quest.
|
||||
|
|
|
|||
|
|
@ -1968,7 +1968,7 @@ static int process_input(struct descriptor_data *t)
|
|||
{
|
||||
write_to_output(t, "All queued commands cancelled.\r\n");
|
||||
flush_queues(t); /* Flush the command queue */
|
||||
return (1); /* No need to process the -- command any further, so quit back out */
|
||||
failed_subst = 1; /* Allow the read point to be moved, but don't add to queue */
|
||||
}
|
||||
|
||||
if (!failed_subst)
|
||||
|
|
|
|||
10
src/db.c
10
src/db.c
|
|
@ -1863,11 +1863,14 @@ char *parse_object(FILE *obj_f, int nr)
|
|||
log("SYSERR: Expecting third numeric line of %s, but file ended!", buf2);
|
||||
exit(1);
|
||||
}
|
||||
if ((retval = sscanf(line, "%d %d %d %d", t, t + 1, t + 2, t + 3)) != 4) {
|
||||
if (retval == 3)
|
||||
if ((retval = sscanf(line, "%d %d %d %d %d", t, t + 1, t + 2, t + 3, t + 4)) != 5) {
|
||||
if (retval == 3) {
|
||||
t[3] = 0;
|
||||
t[4] = 0;
|
||||
} else if (retval == 4)
|
||||
t[4] = 0;
|
||||
else {
|
||||
log("SYSERR: Format error in third numeric line (expecting 4 args, got %d), %s", retval, buf2);
|
||||
log("SYSERR: Format error in third numeric line (expecting 5 args, got %d), %s", retval, buf2);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
|
@ -1876,6 +1879,7 @@ char *parse_object(FILE *obj_f, int nr)
|
|||
GET_OBJ_COST(obj_proto + i) = t[1];
|
||||
GET_OBJ_RENT(obj_proto + i) = t[2];
|
||||
GET_OBJ_LEVEL(obj_proto + i) = t[3];
|
||||
GET_OBJ_TIMER(obj_proto + i) = t[4];
|
||||
|
||||
obj_proto[i].sitting_here = NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ int save_objects(zone_rnum zone_num)
|
|||
|
||||
fprintf(fp, "%d %s %s %s %s %s %s %s %s %s %s %s %s\n"
|
||||
"%d %d %d %d\n"
|
||||
"%d %d %d %d\n",
|
||||
"%d %d %d %d %d\n",
|
||||
|
||||
GET_OBJ_TYPE(obj),
|
||||
ebuf1, ebuf2, ebuf3, ebuf4,
|
||||
|
|
@ -246,7 +246,7 @@ int save_objects(zone_rnum zone_num)
|
|||
GET_OBJ_VAL(obj, 0), GET_OBJ_VAL(obj, 1),
|
||||
GET_OBJ_VAL(obj, 2), GET_OBJ_VAL(obj, 3),
|
||||
GET_OBJ_WEIGHT(obj), GET_OBJ_COST(obj),
|
||||
GET_OBJ_RENT(obj), GET_OBJ_LEVEL(obj)
|
||||
GET_OBJ_RENT(obj), GET_OBJ_LEVEL(obj), GET_OBJ_TIMER(obj)
|
||||
);
|
||||
|
||||
/* Do we have script(s) attached? */
|
||||
|
|
|
|||
|
|
@ -641,7 +641,8 @@ void mag_areas(int level, struct char_data *ch, int spellnum, int savetype)
|
|||
/* The skips: 1: the caster
|
||||
* 2: immortals
|
||||
* 3: if no pk on this mud, skips over all players
|
||||
* 4: pets (charmed NPCs) */
|
||||
* 4: pets (charmed NPCs)
|
||||
* 5: other players in the same group (if the spell is 'violent') */
|
||||
if (tch == ch)
|
||||
continue;
|
||||
if (!IS_NPC(tch) && GET_LEVEL(tch) >= LVL_IMMORT)
|
||||
|
|
@ -650,6 +651,9 @@ void mag_areas(int level, struct char_data *ch, int spellnum, int savetype)
|
|||
continue;
|
||||
if (!IS_NPC(ch) && IS_NPC(tch) && AFF_FLAGGED(tch, AFF_CHARM))
|
||||
continue;
|
||||
if (!IS_NPC(tch) && spell_info[spellnum].violent && AFF_FLAGGED(tch, AFF_GROUP) && AFF_FLAGGED(ch, AFF_GROUP) &&
|
||||
( ((ch->master == NULL) ? ch : ch->master) == ((tch->master == NULL) ? tch : tch->master) ) )
|
||||
continue;
|
||||
|
||||
/* Doesn't matter if they die here so we don't check. -gg 6/24/98 */
|
||||
mag_damage(level, ch, tch, spellnum, 1);
|
||||
|
|
|
|||
|
|
@ -481,7 +481,7 @@ void quest_join(struct char_data *ch, struct char_data *qm, char argument[MAX_IN
|
|||
else if (GET_QUEST(ch) != NOTHING)
|
||||
snprintf(buf, sizeof(buf),
|
||||
"%s But you are already part of a quest!", GET_NAME(ch));
|
||||
else if((vnum = find_quest_by_qmnum(ch, qm->nr, atoi(argument))) == NOTHING)
|
||||
else if((vnum = find_quest_by_qmnum(ch, GET_MOB_VNUM(qm), atoi(argument))) == NOTHING)
|
||||
snprintf(buf, sizeof(buf),
|
||||
"%s I don't know of such a quest!", GET_NAME(ch));
|
||||
else if ((rnum = real_quest(vnum)) == NOTHING)
|
||||
|
|
@ -532,7 +532,7 @@ void quest_list(struct char_data *ch, struct char_data *qm, char argument[MAX_IN
|
|||
qst_vnum vnum;
|
||||
qst_rnum rnum;
|
||||
|
||||
if ((vnum = find_quest_by_qmnum(ch, qm->nr, atoi(argument))) == NOTHING)
|
||||
if ((vnum = find_quest_by_qmnum(ch, GET_MOB_VNUM(qm), atoi(argument))) == NOTHING)
|
||||
send_to_char(ch, "That is not a valid quest!\r\n");
|
||||
else if ((rnum = real_quest(vnum)) == NOTHING)
|
||||
send_to_char(ch, "That is not a valid quest!\r\n");
|
||||
|
|
|
|||
|
|
@ -259,11 +259,11 @@ char *CAP(char *txt)
|
|||
* file. */
|
||||
int get_line(FILE * fl, char *buf)
|
||||
{
|
||||
char temp[256];
|
||||
char temp[256], *buf2;
|
||||
int lines = 0;
|
||||
|
||||
do {
|
||||
fgets(temp, 256, fl);
|
||||
buf2 = fgets(temp, 256, fl);
|
||||
if (feof(fl))
|
||||
return (0);
|
||||
lines++;
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ void convert(char *filename)
|
|||
FILE *fl, *outfile, *index_file;
|
||||
struct char_file_u_plrtoascii player;
|
||||
char index_name[40], outname[40], bits[127];
|
||||
int i;
|
||||
int i, j;
|
||||
struct char_special_data_saved_plrtoascii *csds;
|
||||
struct player_special_data_saved_plrtoascii *psds;
|
||||
struct char_ability_data_plrtoascii *cad;
|
||||
|
|
@ -175,7 +175,7 @@ void convert(char *filename)
|
|||
exit(1);
|
||||
}
|
||||
for (;;) {
|
||||
fread(&player, sizeof(struct char_file_u_plrtoascii), 1, fl);
|
||||
j = fread(&player, sizeof(struct char_file_u_plrtoascii), 1, fl);
|
||||
if (feof(fl)) {
|
||||
fclose(fl);
|
||||
fclose(index_file);
|
||||
|
|
|
|||
|
|
@ -58,12 +58,12 @@ char *fread_string(FILE * fl, const char *error)
|
|||
|
||||
void do_list(FILE * shop_f, FILE * newshop_f, int max)
|
||||
{
|
||||
int count, temp;
|
||||
char buf[MAX_STRING_LENGTH];
|
||||
int count, temp, i;
|
||||
char buf[MAX_STRING_LENGTH], *buf2;
|
||||
|
||||
for (count = 0; count < max; count++) {
|
||||
fscanf(shop_f, "%d", &temp);
|
||||
fgets(buf, MAX_STRING_LENGTH - 1, shop_f);
|
||||
i = fscanf(shop_f, "%d", &temp);
|
||||
buf2 = fgets(buf, MAX_STRING_LENGTH - 1, shop_f);
|
||||
if (temp > 0)
|
||||
fprintf(newshop_f, "%d%s", temp, buf);
|
||||
}
|
||||
|
|
@ -76,8 +76,9 @@ void do_float(FILE * shop_f, FILE * newshop_f)
|
|||
{
|
||||
float f;
|
||||
char str[20];
|
||||
int i;
|
||||
|
||||
fscanf(shop_f, "%f \n", &f);
|
||||
i = fscanf(shop_f, "%f \n", &f);
|
||||
sprintf(str, "%f", f);
|
||||
while ((str[strlen(str) - 1] == '0') && (str[strlen(str) - 2] != '.'))
|
||||
str[strlen(str) - 1] = 0;
|
||||
|
|
@ -87,9 +88,9 @@ void do_float(FILE * shop_f, FILE * newshop_f)
|
|||
|
||||
void do_int(FILE * shop_f, FILE * newshop_f)
|
||||
{
|
||||
int i;
|
||||
int i, j;
|
||||
|
||||
fscanf(shop_f, "%d \n", &i);
|
||||
j = fscanf(shop_f, "%d \n", &i);
|
||||
fprintf(newshop_f, "%d \n", i);
|
||||
}
|
||||
|
||||
|
|
@ -155,7 +156,7 @@ int main(int argc, char *argv[])
|
|||
{
|
||||
FILE *sfp, *nsfp;
|
||||
char fn[256], part[256];
|
||||
int result, index;
|
||||
int result, index, i;
|
||||
|
||||
if (argc < 2) {
|
||||
printf("Usage: shopconv <file1> [file2] [file3] ...\n");
|
||||
|
|
@ -164,7 +165,7 @@ int main(int argc, char *argv[])
|
|||
for (index = 1; index < argc; index++) {
|
||||
sprintf(fn, "%s", argv[index]);
|
||||
sprintf(part, "mv %s %s.tmp", fn, fn);
|
||||
system(part);
|
||||
i = system(part);
|
||||
sprintf(part, "%s.tmp", fn);
|
||||
sfp = fopen(part, "r");
|
||||
if (sfp == NULL) {
|
||||
|
|
@ -181,10 +182,10 @@ int main(int argc, char *argv[])
|
|||
fclose(sfp);
|
||||
if (result) {
|
||||
sprintf(part, "mv %s.tmp %s", fn, fn);
|
||||
system(part);
|
||||
i = system(part);
|
||||
} else {
|
||||
sprintf(part, "mv %s.tmp %s.bak", fn, fn);
|
||||
system(part);
|
||||
i = system(part);
|
||||
printf("Done!\n");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -496,10 +496,10 @@ int real_room(int virtual, int reference)
|
|||
*/
|
||||
int get_line(FILE * fl, char *buf)
|
||||
{
|
||||
char temp[256];
|
||||
char temp[256], *buf2;
|
||||
|
||||
do {
|
||||
fgets(temp, 256, fl);
|
||||
buf2 = fgets(temp, 256, fl);
|
||||
if (*temp)
|
||||
temp[strlen(temp) - 1] = '\0';
|
||||
} while (!feof(fl) && (*temp == '*' || !*temp));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue