Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CF: xp problem patch...




	I am not 100% sure that this is the entire problem; but 
	the code is definitely not right-- I forgot to put in
	brackets on one if/then statement!!. 

	Please try this (short) patch to object.c -- it patches
	set_owner() function.

						-b.t.

*** ../../tarfiles/crossfire-0.92.3/common/object.c	Sat Apr 27 05:03:40 1996
--- ./object.c	Sun Apr 28 02:51:28 1996
***************
*** 277,297 ****
      op->owner=owner;
  
    op->ownercount=owner->count;
    owner->refcount++;
  
! #ifdef ALLOW_SKILLS /* set the pointer in op to owners exp_obj */ 
!   if(owner->type==PLAYER && owner->chosen_skill)
!         if(owner->chosen_skill->exp_obj) {
!                 op->exp_obj = owner->chosen_skill->exp_obj;
!                 op->chosen_skill = owner->chosen_skill;
!         }
  	/* unfortunately, we can't allow summoned monsters skill use
           * because we will need the chosen_skill field to pick the
           * right skill/stat modifiers for calc_skill_exp(). See
           * hit_player() in server/attack.c -b.t. */
!   else if(QUERY_FLAG(op,FLAG_READY_SKILL))
                 CLEAR_FLAG(op,FLAG_READY_SKILL);
  #endif
  }
  
  /*
--- 277,303 ----
      op->owner=owner;
  
    op->ownercount=owner->count;
    owner->refcount++;
  
! #ifdef ALLOW_SKILLS /* set the pointers in op to inherit owners skill, exp_obj */ 
!   if(owner->type==PLAYER&&!(owner->chosen_skill))
! 	LOG(llevDebug,"Warning: set_owner() found player %s has no skill readied.\n"
! 		,owner->name);
!   else if(owner->type==PLAYER&&owner->chosen_skill) { 
! 	/* Set controlled objects pointers to owner's so anything it
! 	 * kills will give exp to the correct owner's exp category.
! 	 * Monsters controlling monsters dont get exp credit in this 
!  	 * scheme */
!         op->chosen_skill = owner->chosen_skill;
!         op->exp_obj = owner->chosen_skill->exp_obj;
! 
  	/* unfortunately, we can't allow summoned monsters skill use
           * because we will need the chosen_skill field to pick the
           * right skill/stat modifiers for calc_skill_exp(). See
           * hit_player() in server/attack.c -b.t. */
!   } else if(QUERY_FLAG(op,FLAG_READY_SKILL))
                 CLEAR_FLAG(op,FLAG_READY_SKILL);
  #endif
  }
  
  /*