So I'm trying to create really simple items in game just to test. Basically I 
copied the code from item_suit.cpp into 2 files (header and cpp), changed some 
names and behaviour in MyTouch method. During load I get an error in utils.cpp :

void CEntityFactoryDictionary::InstallFactory( IEntityFactory *pFactory, const 
char *pClassName )
{
        Assert( FindFactory( pClassName ) == NULL );  // ASSERT FAILS when 
pClassName = item_kevlar
        m_Factories.Insert( pClassName, pFactory );
}

Apparenlty factory cant find a constructor to create an instance (if I 
understand it correctly). There is code of my item..
-----------------------------------------------------------header-----------
class CItemKevlar : public CItem
{
public:
        DECLARE_CLASS(CItemKevlar, CItem);

        void Spawn(void);       
        void Precache(void);
        bool MyTouch(CBasePlayer *pPlayer);     
        int itemNumber(void) { return ACTION_ITEM_KEVLAR; };
        bool isSpecificItem(int);
};

LINK_ENTITY_TO_CLASS(item_kevlar, CItemKevlar); // here is factory method 
called. interesting thing          
                                                                    //that the 
string "item_kelvar"  or "item_suit" can be found only here. 
                                                                    //so I have 
no idea why it cant be found
-----------------------------------------------------------
and in cpp file there is just code of this functions (again, basically it's 
just a copy of item_suit).
How should I fix it?

regards, Michael

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
https://list.valvesoftware.com/cgi-bin/mailman/listinfo/hlcoders

Reply via email to