Code:
case SWORD:  active_weapon = ent_create ( "sword.mdl", my.x, attach_weapon );  break;



'me'/'my' is not a valid pointer in a function called from the inventory engine.

Originally Posted By: Manual

my
me
Pointer to the entity that the current function is executed from or assigned to. Is valid for the whole function and for all functions called from it, and is preserved during wait(). The pointer is invalid if the function was not executed by an entity, e.g. by a key event or called from the main() function.


Code:
action attach_weapon() 
{
...
while (you != NULL)



'you' is not a valid pointer in an action of an entity created by a function called from the inventory engine.

Originally Posted By: Manual

your
you
Pointer to a second entity. Is preserved in functions during wait(), but modified by many functions. At the start of an entity function, you is the pointer to the creating entity (if any), otherwise NULL.


Use 'player' pointer instead.
Salud!

Last edited by txesmi; 01/05/14 10:08.