--- deliantra/server/socket/request.C 2009/12/18 03:49:46 1.162 +++ deliantra/server/socket/request.C 2010/04/02 03:41:25 1.166 @@ -1,9 +1,9 @@ /* * This file is part of Deliantra, the Roguelike Realtime MMORPG. * - * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team - * Copyright (©) 2001,2007 Mark Wedel - * Copyright (©) 1992,2007 Frank Tore Johansen + * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2001 Mark Wedel + * Copyright (©) 1992 Frank Tore Johansen * * Deliantra is free software: you can redistribute it and/or modify it under * the terms of the Affero GNU General Public License as published by the @@ -738,6 +738,13 @@ { dynbuf_text &buf = msg_dynbuf; buf.clear (); + printf ("%s %s => %s (%s)\n",//D + pl->ranged_ob ? &pl->ranged_ob->name : "-", + pl->combat_ob ? &pl->combat_ob->name : "-", + pl->ob->current_weapon ? &pl->ob->current_weapon->name : "-", + pl->ob->chosen_skill ? &pl->ob->chosen_skill->name : "-" + ); + if (pl->ranged_ob) buf << " Range" << (pl->ob->current_weapon == pl->ranged_ob ? "*" : "") << ": " << pl->ranged_ob->name; @@ -1281,46 +1288,48 @@ return; for (object *spell = pl->ob->inv; spell; spell = spell->below) - { - if (spell->type == SPELL) - { - int flags = 0; + if (spell->type == SPELL) + { + int flags = 0; + int val; - /* check if we need to update it */ - if (spell->cached_sp != SP_level_spellpoint_cost (pl->ob, spell, SPELL_MANA)) - { - spell->cached_sp = SP_level_spellpoint_cost (pl->ob, spell, SPELL_MANA); - flags |= UPD_SP_MANA; - } + /* check if we need to update it */ + val = SP_level_spellpoint_cost (pl->ob, spell, SPELL_MANA); + if (spell->cached_sp != val) + { + spell->cached_sp = val; + flags |= UPD_SP_MANA; + } - if (spell->cached_grace != SP_level_spellpoint_cost (pl->ob, spell, SPELL_GRACE)) - { - spell->cached_grace = SP_level_spellpoint_cost (pl->ob, spell, SPELL_GRACE); - flags |= UPD_SP_GRACE; - } + val = SP_level_spellpoint_cost (pl->ob, spell, SPELL_GRACE); + if (spell->cached_grace != val) + { + spell->cached_grace = val; + flags |= UPD_SP_GRACE; + } - if (spell->cached_eat != spell->stats.dam + SP_level_dam_adjust (pl->ob, spell)) - { - spell->cached_eat = spell->stats.dam + SP_level_dam_adjust (pl->ob, spell); - flags |= UPD_SP_DAMAGE; - } + val = casting_level (pl->ob, spell); + if (spell->cached_eat != val) + { + spell->cached_eat = val; + flags |= UPD_SP_LEVEL; + } - if (flags) - { - packet sl; + if (flags) + { + packet sl; - sl << "updspell " - << uint8 (flags) - << uint32 (spell->count); + sl << "updspell " + << uint8 (flags) + << uint32 (spell->count); - if (flags & UPD_SP_MANA ) sl << uint16 (spell->cached_sp); - if (flags & UPD_SP_GRACE ) sl << uint16 (spell->cached_grace); - if (flags & UPD_SP_DAMAGE) sl << uint16 (spell->cached_eat); + if (flags & UPD_SP_MANA ) sl << uint16 (spell->cached_sp); + if (flags & UPD_SP_GRACE) sl << uint16 (spell->cached_grace); + if (flags & UPD_SP_LEVEL) sl << uint16 (spell->cached_eat); - pl->ns->send_packet (sl); - } - } - } + pl->ns->send_packet (sl); + } + } } void @@ -1357,7 +1366,7 @@ /* store costs and damage in the object struct, to compare to later */ spell->cached_sp = SP_level_spellpoint_cost (pl->ob, spell, SPELL_MANA); spell->cached_grace = SP_level_spellpoint_cost (pl->ob, spell, SPELL_GRACE); - spell->cached_eat = spell->stats.dam + SP_level_dam_adjust (pl->ob, spell); + spell->cached_eat = casting_level (pl->ob, spell); /* figure out which skill it uses, if it uses one */ if (spell->skill)