sending pointer through send_skill

Posted By: Reconnoiter

sending pointer through send_skill - 06/10/14 14:41

Hey,

Is sending a pointer of an entity through send_skill a reliable way to get the pointer on the entity on e.g. clients? Like this?;

Code:
//server
f ((connection & CONNECT_SERVER) || connection == 0) {
my.ENEMY = pointer_player[i];
send_skill(my.ENEMY,SEND_ALL);
}

...

//on both
if (my.ENEMY != 0) pointer_enemy_player = my.ENEMY;



I need to be sure, am doing the bug cleaning.
Posted By: Uhrwerk

Re: sending pointer through send_skill - 06/10/14 15:24

No. Think about what a pointer actually is and then think about how useful this information is on a different machine...
Posted By: Reconnoiter

Re: sending pointer through send_skill - 06/10/14 17:50

Good to hear that actually, makes my debugging time shorter now I know that is a problem.

-edit, forgot the handle thingy, it works good know. Ty Uhrwerk
Posted By: EpsiloN

Re: sending pointer through send_skill - 04/09/15 22:58

I'm not sure if I understood you, but I think you misunderstood him laugh
A pointer is only valid on your machine. It points to a place in your memory. On another machine it has a different value (points to a different entity, or if you're !lucky! to the same entity).
Instead, identify your entities by client_id and other custom ID methods...
© 2024 lite-C Forums