--- deliantra/server/server/move.c 2006/02/22 18:53:56 1.4 +++ deliantra/server/server/move.c 2006/03/20 23:58:15 1.5 @@ -216,7 +216,7 @@ */ int teleport (object *teleporter, uint8 tele_type, object *user) { - object *altern[120]; /* Better use c/malloc here in the future */ + object *altern; int i,j,k,nrofalt=0; object *other_teleporter, *tmp; mapstruct *m; @@ -244,8 +244,8 @@ if (other_teleporter->type == tele_type) break; other_teleporter = other_teleporter->above; } - if (other_teleporter) - altern[nrofalt++]=other_teleporter; + if (other_teleporter && !(RANDOM() % ++nrofalt)) + altern = other_teleporter; } if(!nrofalt) { @@ -253,7 +253,7 @@ return 0; } - other_teleporter=altern[RANDOM()%nrofalt]; + other_teleporter=altern; k=find_free_spot(user,other_teleporter->map, other_teleporter->x,other_teleporter->y,1,9);