Question about entities


(Ododo) #1

Hello, I have a question about ET source code.
I wonder where these functions of structure gentity_t defined in g_local.h


        void (*free)(gentity_t *self);
        void (*think)(gentity_t *self);
        void (*reached)(gentity_t *self); // movers call this when hitting endpoint
        void (*blocked)(gentity_t *self, gentity_t *other);
        void (*touch)(gentity_t *self, gentity_t *other, trace_t *trace);
        void (*use)(gentity_t *self, gentity_t *other, gentity_t *activator);
        void (*pain)(gentity_t *self, gentity_t *attacker, int damage, vec3_t point);
        void (*die)(gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod);

Are implemented.
thanks


(gaoesa) #2

Those are function pointers. The implementations depend of the entity types and those can be set to NULL as well. You need to search for the places where the entities are created to see what functions are set to these.