<snip>

Hi, my problem here is this. im trying to make an online race editor, so

i've got the int's maxRace,maxPCRace,and maxNPCRace, int merc.h i've
defined 
them like this:

int maxClass;
int maxRace;
int maxNPCRace;
int maxPCRace;
int maxGroup;
int maxSocial;

/*
* Global variables
*/
extern          int                     maxPCRace;
extern          int                     maxNPCRace;
extern          int                     maxRace;
extern          int                     maxClass;
extern          int                     maxSocial;
extern          int                     maxGroup;

<snip>

Shouldn't you be declaring the variables themselves in some .c file or
something, and putting the extern reference into merc.h like you have it
above?  Otherwise, wouldn't they put all the globals in db.c into merc.h
instead?  Maybe this is causing some weird conflicts since every single
file w/ merc.h included has the variable defined in its own global scope
(for that file) as well as an extern reference to those variables in the
global scope of the program... Just an idea...

Richard Lindsey 

-----Original Message-----
From: Tristan M [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 26, 2005 12:02 PM
To: [email protected]
Subject: My external int doesnt want to work...


all those other integers work fine and i use the same method to load
them 
from the file. here's how i get these:

        fscanf (fp, "%d %d\n", &maxPCRace, &maxNPCRace);
        pc_race_table = malloc (sizeof(struct pc_race_type) *
(maxPCRace+1));
        race_table = malloc (sizeof(struct race_type) * (maxNPCRace+1));
        maxRace = maxPCRace + maxNPCRace;

that works fine too, i log it as they load and it says:
loaded 33 Races, 4 PC, and 29 NPC

so i'm happy with that, however at some point maxRace and maxPCRace get 
thrown into nothing, in my raedit_list command im logging it to show me
how 
many i have and this is what comes up:

MAX_RACE: 0   pc: 12123231   npc: 29

so i cant figure out why 2 would be screwed up whereas 1 would remain
fine, 
i cant find any spot in the code that would do this either. could anyone

please help me out?


-- 
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom

Reply via email to