--- deliantra/server/socket/request.C 2007/06/06 17:22:55 1.105 +++ deliantra/server/socket/request.C 2007/07/01 04:08:14 1.111 @@ -473,27 +473,6 @@ } /** - * client requested an image. send it rate-limited - * before flushing. - */ -void -AskFaceCmd (char *buf, int len, client *ns) -{ - ns->askface.push_back (atoi (buf)); -} - -/** - * Tells client the picture it has to use - * to smooth a picture number given as argument. - */ -void -AskSmooth (char *buf, int len, client *ns) -{ - ns->send_face (atoi (buf)); - ns->flush_fx (); -} - -/** * This handles the general commands from the client (ie, north, fire, cast, * etc.) */ @@ -733,9 +712,6 @@ { dynbuf_text buf; - if (pl->observe->contr) - pl = pl->observe->contr; - if (pl->ranged_ob) buf << " Range" << (pl->ob->current_weapon == pl->ranged_ob ? "*" : "") << ": " << pl->ranged_ob->name; @@ -752,8 +728,8 @@ if (pl->golem) buf << " Golem*: " << pl->golem->name; + buf << '\0'; buf.linearise (obuf); - obuf [buf.size ()] = 0; } #define AddIfInt64(Old,New,Type) if (Old != New) {\ @@ -801,6 +777,8 @@ if (!ob) return; + player *opl = ob->contr ? static_cast(ob->contr) : pl; + packet sl ("stats"); AddIfShort (ns->last_stats.hp, ob->stats.hp, CS_STAT_HP); @@ -818,7 +796,7 @@ AddIfShort (ns->last_stats.Cha, ob->stats.Cha, CS_STAT_CHA); for (int s = 0; s < NUM_SKILLS; s++) - if (object *skill = pl->last_skill_ob[s]) + if (object *skill = opl->last_skill_ob[s]) if (skill->stats.exp != ns->last_skill_exp [s]) { ns->last_skill_exp [s] = skill->stats.exp; @@ -843,10 +821,10 @@ flags = 0; - if (pl->fire_on) + if (opl->fire_on) flags |= SF_FIREON; - if (pl->run_on) + if (opl->run_on) flags |= SF_RUNON; AddIfShort (ns->last_flags, flags, CS_STAT_FLAGS); @@ -870,7 +848,7 @@ AddIfInt (ns->last_path_denied, ob->path_denied, CS_STAT_SPELL_DENY); } - rangetostring (pl, buf); /* we want use the new fire & run system in new client */ + rangetostring (opl, buf); /* we want use the new fire & run system in new client */ AddIfString (ns->stats.range, buf, CS_STAT_RANGE); set_title (ob, buf); AddIfString (ns->stats.title, buf, CS_STAT_TITLE); @@ -1033,12 +1011,10 @@ return; int x, y, ax, ay, startlen, max_x, max_y, oldlen; - sint16 nx, ny; int estartlen, eoldlen; uint8 eentrysize; uint16 ewhatstart, ewhatflag; uint8 extendedinfos; - maptile *m; check_map_change (pl); prefetch_surrounding_maps (pl->ob); @@ -1114,9 +1090,25 @@ for (y = ob->y - socket.mapy / 2; y < max_y; y++, ay++) { + sint16 nx, ny; + maptile *m = 0; + ax = 0; for (x = ob->x - socket.mapx / 2; x < max_x; x++, ax++) { + // check to see if we can simply go one right quickly + ++nx; + if (m && nx >= m->width) + m = 0; + + if (!m) + { + nx = x; ny = y; m = plmap; + + if (!xy_normalise (m, nx, ny)) + m = 0; + } + int emask, mask; emask = mask = (ax & 0x3f) << 10 | (ay & 0x3f) << 4; @@ -1125,10 +1117,6 @@ /* If the coordinates are not valid, or it is too dark to see, * we tell the client as such */ - nx = x; - ny = y; - m = get_map_from_coord (plmap, &nx, &ny); - if (!m) { /* space is out of map. Update space and clear values @@ -1219,6 +1207,7 @@ lastcell.count = d; mapspace &ms = m->at (nx, ny); + ms.update (); if (socket.extmap) {