… | |
… | |
833 | AddIfShort (ns->last_stats.Wis, ob->stats.Wis, CS_STAT_WIS); |
833 | AddIfShort (ns->last_stats.Wis, ob->stats.Wis, CS_STAT_WIS); |
834 | AddIfShort (ns->last_stats.Pow, ob->stats.Pow, CS_STAT_POW); |
834 | AddIfShort (ns->last_stats.Pow, ob->stats.Pow, CS_STAT_POW); |
835 | AddIfShort (ns->last_stats.Cha, ob->stats.Cha, CS_STAT_CHA); |
835 | AddIfShort (ns->last_stats.Cha, ob->stats.Cha, CS_STAT_CHA); |
836 | |
836 | |
837 | for (int s = 0; s < NUM_SKILLS; s++) |
837 | for (int s = 0; s < NUM_SKILLS; s++) |
838 | if (object *skill = opl->last_skill_ob[s]) |
838 | if (object *skill = opl->last_skill_ob [s]) |
839 | if (skill->stats.exp != ns->last_skill_exp [s]) |
839 | if (skill->stats.exp != ns->last_skill_exp [s]) |
840 | { |
840 | { |
841 | ns->last_skill_exp [s] = skill->stats.exp; |
841 | ns->last_skill_exp [s] = skill->stats.exp; |
842 | |
842 | |
843 | /* Always send along the level if exp changes. This is only |
843 | /* Always send along the level if exp changes. This is only |
… | |
… | |
912 | << uint32 (pl->ob->face) |
912 | << uint32 (pl->ob->face) |
913 | << data8 (pl->ob->name); |
913 | << data8 (pl->ob->name); |
914 | |
914 | |
915 | pl->ns->last_weight = weight; |
915 | pl->ns->last_weight = weight; |
916 | pl->ns->send_packet (sl); |
916 | pl->ns->send_packet (sl); |
917 | SET_FLAG (pl->ob, FLAG_CLIENT_SENT); |
|
|
918 | } |
917 | } |
919 | |
918 | |
920 | /****************************************************************************** |
919 | /****************************************************************************** |
921 | * |
920 | * |
922 | * Start of map related commands. |
921 | * Start of map related commands. |
… | |
… | |
1329 | |
1328 | |
1330 | /* Middle face */ |
1329 | /* Middle face */ |
1331 | if (update_space (sl, socket, ms, lastcell, 1)) |
1330 | if (update_space (sl, socket, ms, lastcell, 1)) |
1332 | mask |= 0x2; |
1331 | mask |= 0x2; |
1333 | |
1332 | |
|
|
1333 | if (ob->invisible |
|
|
1334 | && ob->invisible & (ob->invisible < 50 ? 1 : 7) |
1334 | if (ms.player () == ob |
1335 | && ms.player () == ob) |
1335 | && (ob->invisible & (ob->invisible < 50 ? 1 : 7))) |
|
|
1336 | { |
1336 | { |
1337 | // force player to be visible to himself if invisible |
1337 | // force player to be visible to himself if invisible |
1338 | if (lastcell.faces[0] != ob->face) |
1338 | if (lastcell.faces[0] != ob->face) |
1339 | { |
1339 | { |
1340 | lastcell.faces[0] = ob->face; |
1340 | lastcell.faces[0] = ob->face; |
… | |
… | |
1436 | { |
1436 | { |
1437 | packet sl; |
1437 | packet sl; |
1438 | sl << "replyinfo skill_info\n"; |
1438 | sl << "replyinfo skill_info\n"; |
1439 | |
1439 | |
1440 | for (int i = 1; i < NUM_SKILLS; i++) |
1440 | for (int i = 1; i < NUM_SKILLS; i++) |
1441 | sl.printf ("%d:%s\n", i + CS_STAT_SKILLINFO, &skill_names[i]); |
1441 | sl.printf ("%d:%s\n", i + CS_STAT_SKILLINFO, &skill_names [i]); |
1442 | |
1442 | |
1443 | if (sl.length () > MAXSOCKBUF) |
1443 | if (sl.length () > MAXSOCKBUF) |
1444 | { |
1444 | { |
1445 | LOG (llevError, "Buffer overflow in send_skill_info!\n"); |
1445 | LOG (llevError, "Buffer overflow in send_skill_info!\n"); |
1446 | fatal (0); |
1446 | fatal (0); |
… | |
… | |
1564 | spell->cached_grace = SP_level_spellpoint_cost (pl->ob, spell, SPELL_GRACE); |
1564 | spell->cached_grace = SP_level_spellpoint_cost (pl->ob, spell, SPELL_GRACE); |
1565 | spell->cached_eat = spell->stats.dam + SP_level_dam_adjust (pl->ob, spell); |
1565 | spell->cached_eat = spell->stats.dam + SP_level_dam_adjust (pl->ob, spell); |
1566 | |
1566 | |
1567 | /* figure out which skill it uses, if it uses one */ |
1567 | /* figure out which skill it uses, if it uses one */ |
1568 | if (spell->skill) |
1568 | if (spell->skill) |
1569 | { |
1569 | if (object *tmp = pl->find_skill (spell->skill)) |
1570 | for (i = 1; i < NUM_SKILLS; i++) |
|
|
1571 | if (!strcmp (spell->skill, skill_names[i])) |
|
|
1572 | { |
|
|
1573 | skill = i + CS_STAT_SKILLINFO; |
1570 | skill = tmp->subtype + CS_STAT_SKILLINFO; |
1574 | break; |
|
|
1575 | } |
|
|
1576 | } |
|
|
1577 | |
1571 | |
1578 | // spells better have a face |
1572 | // spells better have a face |
1579 | if (!spell->face) |
1573 | if (!spell->face) |
1580 | { |
1574 | { |
1581 | LOG (llevError, "%s: spell has no face, but face is mandatory.\n", &spell->name); |
1575 | LOG (llevError, "%s: spell has no face, but face is mandatory.\n", &spell->name); |