--- deliantra/server/socket/request.c 2006/02/03 07:14:46 1.1.1.1 +++ deliantra/server/socket/request.c 2006/02/22 18:03:29 1.1.1.2 @@ -364,7 +364,7 @@ * if we know the client wants it, might as well push it to the * client. */ -void SendSmooth(NewSocket *ns, uint16 face) { +static void SendSmooth(NewSocket *ns, uint16 face) { uint16 smoothface; uint8 reply[MAX_BUF]; SockList sl; @@ -1738,18 +1738,24 @@ New_Face *floor2; int d, mflags; struct Map newmap; - mapstruct *m; + mapstruct *m, *pm; if (pl->type != PLAYER) { LOG(llevError,"draw_client_map called with non player/non eric-server\n"); return; } - /* IF player is just joining the game, he isn't here yet, so the map + if (pl->contr->transport) { + pm = pl->contr->transport->map; + } + else + pm = pl->map; + + /* If player is just joining the game, he isn't here yet, so the map * can get swapped out. If so, don't try to send them a map. All will * be OK once they really log in. */ - if (pl->map==NULL || pl->map->in_memory!=MAP_IN_MEMORY) return; + if (pm==NULL || pm->in_memory!=MAP_IN_MEMORY) return; memset(&newmap, 0, sizeof(struct Map)); @@ -1757,7 +1763,7 @@ for(i = (pl->x - pl->contr->socket.mapx/2) ; i < (pl->x + (pl->contr->socket.mapx+1)/2); i++) { ax=i; ay=j; - m = pl->map; + m = pm; mflags = get_map_flags(m, &m, ax, ay, &ax, &ay); if (mflags & P_OUT_OF_MAP) continue; @@ -1809,7 +1815,7 @@ */ nx = i; ny = j; - m = get_map_from_coord(pl->map, &nx, &ny); + m = get_map_from_coord(pm, &nx, &ny); if (m && d<4) { face = GET_MAP_FACE(m, nx, ny,0); floor2 = GET_MAP_FACE(m, nx, ny,1); @@ -2013,7 +2019,7 @@ /* appends the spell *spell to the Socklist we will send the data to. */ static void append_spell (player *pl, SockList *sl, object *spell) { - int len, i, skill=0; + int len, i, skill=0; if (!(spell->name)) { LOG(llevError, "item number %d is a spell with no name.\n", spell->count); @@ -2031,13 +2037,14 @@ SockList_AddShort(sl, spell->last_grace); SockList_AddShort(sl, spell->last_eat); - /* figure out which skill it uses */ - for (i=1; i< NUM_SKILLS; i++) - if (!strcmp(spell->skill, skill_names[i])) { - skill = i+CS_STAT_SKILLINFO; - break; - } - skill = i+CS_STAT_SKILLINFO; + /* figure out which skill it uses, if it uses one */ + if (spell->skill) { + for (i=1; i< NUM_SKILLS; i++) + if (!strcmp(spell->skill, skill_names[i])) { + skill = i+CS_STAT_SKILLINFO; + break; + } + } SockList_AddChar(sl, skill); SockList_AddInt(sl, spell->path_attuned);