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

Comparing deliantra/server/server/player.C (file contents):
Revision 1.1 by elmex, Sun Aug 13 17:16:04 2006 UTC vs.
Revision 1.2 by elmex, Tue Aug 15 16:19:55 2006 UTC

1/* 1/*
2 * static char *rcsid_player_c = 2 * static char *rcsid_player_c =
3 * "$Id: player.C,v 1.1 2006/08/13 17:16:04 elmex Exp $"; 3 * "$Id: player.C,v 1.2 2006/08/15 16:19:55 elmex Exp $";
4 */ 4 */
5 5
6/* 6/*
7 CrossFire, A Multiplayer game for X-windows 7 CrossFire, A Multiplayer game for X-windows
8 8
3059 3059
3060/* cast_dust() - handles op throwing objects of type 'DUST'. 3060/* cast_dust() - handles op throwing objects of type 'DUST'.
3061 * This is much simpler in the new spell code - we basically 3061 * This is much simpler in the new spell code - we basically
3062 * just treat this as any other spell casting object. 3062 * just treat this as any other spell casting object.
3063 */ 3063 */
3064 3064
3065void
3065void cast_dust (object *op, object *throw_ob, int dir) { 3066cast_dust (object * op, object * throw_ob, int dir)
3067{
3066 object *skop, *spob; 3068 object *skop, *spob;
3067 3069
3068 skop = find_skill_by_name(op, throw_ob->skill); 3070 skop = find_skill_by_name (op, throw_ob->skill);
3069 3071
3070 /* casting POTION 'dusts' is really a use_magic_item skill */ 3072 /* casting POTION 'dusts' is really a use_magic_item skill */
3071 if(op->type==PLAYER && throw_ob->type==POTION && !skop) { 3073 if (op->type == PLAYER && throw_ob->type == POTION && !skop)
3074 {
3072 LOG(llevError,"Player %s lacks critical skill use_magic_item!\n", 3075 LOG (llevError, "Player %s lacks critical skill use_magic_item!\n",
3073 op->name); 3076 op->name);
3074 return; 3077 return;
3075 } 3078 }
3079
3076 spob = throw_ob->inv; 3080 spob = throw_ob->inv;
3081
3082 // elmex Tue Aug 15 17:19:46 CEST 2006: Added this check to
3083 // not pass NULL to cast_spell (which did indeed check itself, but
3084 // errors should be reported as early as possible IMHO)
3085 if (!spob)
3086 {
3087 LOG (llevError, "cast_dust: thrown object %s (by %s) had no spell in it!",
3088 throw_ob->name, op->name);
3089 return;
3090 }
3091
3077 if (op->type==PLAYER && spob) 3092 if (op->type == PLAYER)
3078 new_draw_info_format(NDI_UNIQUE, 0,op,"You cast %s.",spob->name); 3093 new_draw_info_format (NDI_UNIQUE, 0, op, "You cast %s.", spob->name);
3079 3094
3080 cast_spell(op, throw_ob, dir, spob, NULL); 3095 cast_spell (op, throw_ob, dir, spob, NULL);
3081 3096
3082 if(!QUERY_FLAG(throw_ob,FLAG_REMOVED)) remove_ob(throw_ob); 3097 if (!QUERY_FLAG (throw_ob, FLAG_REMOVED))
3098 remove_ob (throw_ob);
3083 free_object(throw_ob); 3099 free_object (throw_ob);
3084} 3100}
3085 3101
3086void make_visible (object *op) { 3102void make_visible (object *op) {
3087 op->hide = 0; 3103 op->hide = 0;
3088 op->invisible = 0; 3104 op->invisible = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines