Plugin vector variable changes
#5

Code:
cell *dest = NULL;
amx_GetAddr(amx,params[2],&dest);
int amount_of_nodes = params[1];
RouteID.push_back(IDcounter);
RouteVector.push_back(RouteData(dest,amount_of_nodes,IDcounter));
amx_GetAddr only returns the address to the cell array stored by the interpreter. After your function and the PAWN function(s) that called it return, the array gets freed in most cases, so you cannot just use this reference, but you have to allocate new memory, copy the values there and free the memory when you no longer need it (usually when you remove it from the list).
Reply


Messages In This Thread
Plugin vector variable changes - by Gamer_Z - 28.11.2011, 20:58
Re: Plugin vector variable changes - by Kar - 28.11.2011, 21:15
Re: Plugin vector variable changes - by FireCat - 28.11.2011, 21:27
Re: Plugin vector variable changes - by Gamer_Z - 28.11.2011, 21:28
AW: Plugin vector variable changes - by Fabsch - 29.11.2011, 11:43
Re: AW: Plugin vector variable changes - by Gamer_Z - 29.11.2011, 15:14
AW: Plugin vector variable changes - by Fabsch - 29.11.2011, 16:15
Re: AW: Plugin vector variable changes - by Gamer_Z - 29.11.2011, 16:24
AW: Plugin vector variable changes - by Fabsch - 29.11.2011, 18:08
Re: Plugin vector variable changes - by Gamer_Z - 29.11.2011, 22:29

Forum Jump:


Users browsing this thread: 1 Guest(s)