ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/request.C
(Generate patch)

Comparing deliantra/server/socket/request.C (file contents):
Revision 1.162 by root, Fri Dec 18 03:49:46 2009 UTC vs.
Revision 1.163 by root, Mon Mar 22 00:56:57 2010 UTC

1279 1279
1280 if (!pl->ns->monitor_spells) 1280 if (!pl->ns->monitor_spells)
1281 return; 1281 return;
1282 1282
1283 for (object *spell = pl->ob->inv; spell; spell = spell->below) 1283 for (object *spell = pl->ob->inv; spell; spell = spell->below)
1284 {
1285 if (spell->type == SPELL) 1284 if (spell->type == SPELL)
1286 { 1285 {
1287 int flags = 0; 1286 int flags = 0;
1287 int val;
1288 1288
1289 /* check if we need to update it */ 1289 /* check if we need to update it */
1290 if (spell->cached_sp != SP_level_spellpoint_cost (pl->ob, spell, SPELL_MANA)) 1290 val = SP_level_spellpoint_cost (pl->ob, spell, SPELL_MANA);
1291 if (spell->cached_sp != val)
1291 { 1292 {
1292 spell->cached_sp = SP_level_spellpoint_cost (pl->ob, spell, SPELL_MANA); 1293 spell->cached_sp = val;
1293 flags |= UPD_SP_MANA; 1294 flags |= UPD_SP_MANA;
1294 } 1295 }
1295 1296
1296 if (spell->cached_grace != SP_level_spellpoint_cost (pl->ob, spell, SPELL_GRACE)) 1297 val = SP_level_spellpoint_cost (pl->ob, spell, SPELL_GRACE);
1298 if (spell->cached_grace != val)
1297 { 1299 {
1298 spell->cached_grace = SP_level_spellpoint_cost (pl->ob, spell, SPELL_GRACE); 1300 spell->cached_grace = val;
1299 flags |= UPD_SP_GRACE; 1301 flags |= UPD_SP_GRACE;
1300 } 1302 }
1301 1303
1302 if (spell->cached_eat != spell->stats.dam + SP_level_dam_adjust (pl->ob, spell)) 1304 val = casting_level (pl->ob, spell);
1305 if (spell->cached_eat != val)
1303 { 1306 {
1304 spell->cached_eat = spell->stats.dam + SP_level_dam_adjust (pl->ob, spell); 1307 spell->cached_eat = val;
1305 flags |= UPD_SP_DAMAGE; 1308 flags |= UPD_SP_LEVEL;
1306 } 1309 }
1307 1310
1308 if (flags) 1311 if (flags)
1309 { 1312 {
1310 packet sl; 1313 packet sl;
1311 1314
1312 sl << "updspell " 1315 sl << "updspell "
1313 << uint8 (flags) 1316 << uint8 (flags)
1314 << uint32 (spell->count); 1317 << uint32 (spell->count);
1315 1318
1316 if (flags & UPD_SP_MANA ) sl << uint16 (spell->cached_sp); 1319 if (flags & UPD_SP_MANA ) sl << uint16 (spell->cached_sp);
1317 if (flags & UPD_SP_GRACE ) sl << uint16 (spell->cached_grace); 1320 if (flags & UPD_SP_GRACE) sl << uint16 (spell->cached_grace);
1318 if (flags & UPD_SP_DAMAGE) sl << uint16 (spell->cached_eat); 1321 if (flags & UPD_SP_LEVEL) sl << uint16 (spell->cached_eat);
1319 1322
1320 pl->ns->send_packet (sl); 1323 pl->ns->send_packet (sl);
1321 } 1324 }
1322 } 1325 }
1323 }
1324} 1326}
1325 1327
1326void 1328void
1327esrv_remove_spell (player *pl, object *spell) 1329esrv_remove_spell (player *pl, object *spell)
1328{ 1330{
1355 } 1357 }
1356 1358
1357 /* store costs and damage in the object struct, to compare to later */ 1359 /* store costs and damage in the object struct, to compare to later */
1358 spell->cached_sp = SP_level_spellpoint_cost (pl->ob, spell, SPELL_MANA); 1360 spell->cached_sp = SP_level_spellpoint_cost (pl->ob, spell, SPELL_MANA);
1359 spell->cached_grace = SP_level_spellpoint_cost (pl->ob, spell, SPELL_GRACE); 1361 spell->cached_grace = SP_level_spellpoint_cost (pl->ob, spell, SPELL_GRACE);
1360 spell->cached_eat = spell->stats.dam + SP_level_dam_adjust (pl->ob, spell); 1362 spell->cached_eat = casting_level (pl->ob, spell);
1361 1363
1362 /* figure out which skill it uses, if it uses one */ 1364 /* figure out which skill it uses, if it uses one */
1363 if (spell->skill) 1365 if (spell->skill)
1364 if (object *tmp = pl->find_skill (spell->skill)) 1366 if (object *tmp = pl->find_skill (spell->skill))
1365 skill = tmp->subtype + CS_STAT_SKILLINFO; 1367 skill = tmp->subtype + CS_STAT_SKILLINFO;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines