Original Post
Right now I''m using a base class, THING, and several derived classes in my app. I''m storing everything in a vector<thING*> called g_Things. To reference a thing I use a DWORD ID that is generated in the THING constructor like so:
THING::THING(...)
{
ID = g_Things.size();
g_Things.push_back(this);
...
}
or, in my ACTOR : public THING class,
ACTOR::ACTOR(...)
{
ID = g_Things.size();
g_Things.push_back(this);
...
}
which is the same thing. The problem that I''m having is that upon initialization everything works fine, except two THINGs (namely my level THING and my player ACTOR) both get set to ID''s of 0. Is this just something weird I''m doing wrong with using size? Or might it have something to do with the fact that I''m using multiple extern''s to that vector or something? Any ideas? If you need to see more code, I''d be happy to share.
Thanks for your time and help!