Hi Ruben,
I don't know where to start. I fear that answering your question and giving you the solution is not really a good solution. It will probably become to a similar problem in very few code lines.

Forget about my code by the moment and look at yours. It is absolutely necessary to understand its content before trying to adapt nothing. Socrates would say that the answer was in you all the time (maieutics) so...

Could you explain each code line contained into your 'attach_weapon' function? Let me read it. Be neat!

If not, could you enumerate, explain and reference each pointer into your 'attach_weapon' function?

If not, do you know what a pointer is?

If not, take the time to read the AUM liteC pointers tutorial (at least twice :D)

With manual and pointers in your circle of acquaintances you should be able to answer the second question and probably the first and yours. If not, I can guide you to find the problem by yourself. It deserves the effort. Otherwise I can not easily explain what is wrong.

Does this help?

pd: peripheral reading: AUM liteC structs tutorial

Last edited by txesmi; 02/02/14 23:18.