I'm not sure what I'm doing wrong, but I have an ENTITY** spawn_places that I initialize on the server via
Code:
spawn_places = sys_malloc(sizeof(ENTITY*)*size);

and I fill each array element with ENTITY* pointers.

When a player connects, I run on the client (after receiving the sizeof_spawn_places):
Code:
spawn_places = sys_malloc(sizeof(ENTITY*)*sizeof_spawn_places);
client_ask_for_spawn_places = 1;
send_var_to(NULL,client_ask_for_spawn_places);


And the server EVENT code:
Code:
client_ask_for_spawn_places = 0;
void on_server_event(void* ptr, var cl_id)
{
	switch(event_type)
	{
		case EVENT_VAR:
			if(ptr == &client_ask_for_spawn_places){ 
				send_var_id(cl_id,&spawn_places);
				
			}
			break;
	}
}



However, when I try to access spawn_places[0] as an ENTITY* on the client: my game crashes. For some reason the ENTITY** array isn't being sent properly; I can access the ENTITY** properly on the server. I do this exact same method for sending a variable and it works. What am I doing wrong?

Last edited by 82RJZAE; 06/11/13 09:59.