[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:
Rumble
2009-01-24 19:11:02 +00:00
parent b458c58878
commit c9c7ed9e7a
11 changed files with 41 additions and 26 deletions

View File

@@ -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++;

View File

@@ -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);

View 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");
}
}

View File

@@ -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));