Difference for server/apply.c from version 1.83 to 1.84


version 1.83 version 1.84
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_apply_c =   * static char *rcsid_apply_c =
  *   "$Id: apply.c,v 1.83 2003/06/19 06:52:49 mwedel Exp $";   *   "$Id: apply.c,v 1.84 2003/06/26 11:27:43 gros Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 856
 
Line 856
   
 int esrv_apply_container (object *op, object *sack)  int esrv_apply_container (object *op, object *sack)
 {  {
       event *evt;
     object *tmp=op->container;      object *tmp=op->container;
   
     if(op->type!=PLAYER)      if(op->type!=PLAYER)
Line 877
 
Line 878
      CLEAR_FLAG (op->container, FLAG_FLY_OFF);       CLEAR_FLAG (op->container, FLAG_FLY_OFF);
  }   }
  /* GROS: Handle for plugin close event */   /* GROS: Handle for plugin close event */
  if(tmp->event_hook[EVENT_CLOSE] != NULL)      if ((evt = find_event(tmp, EVENT_CLOSE)) != NULL)
  {   {
  CFParm CFP;   CFParm CFP;
  CFParm* CFR;   CFParm* CFR;
Line 895
 
Line 896
  CFP.Value[6] = &m;   CFP.Value[6] = &m;
  CFP.Value[7] = &m;   CFP.Value[7] = &m;
  CFP.Value[8] = &l;   CFP.Value[8] = &l;
  CFP.Value[9] = tmp->event_hook[k];   CFP.Value[9] = evt->hook;
  CFP.Value[10]= tmp->event_options[k];   CFP.Value[10]= evt->options;
  if (findPlugin(tmp->event_plugin[k])>=0)   if (findPlugin(evt->plugin)>=0)
  {   {
  CFR = (PlugList[findPlugin(tmp->event_plugin[k])].eventfunc) (&CFP);   CFR = (PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP);
  rtn_script = *(int *)(CFR->Value[0]);   rtn_script = *(int *)(CFR->Value[0]);
  if (rtn_script!=0) return 1;   if (rtn_script!=0) return 1;
  }   }
Line 1128
 
Line 1129
 void move_apply (object *trap, object *victim, object *originator)  void move_apply (object *trap, object *victim, object *originator)
 {  {
   static int recursion_depth = 0;    static int recursion_depth = 0;
     event *evt;
   
   /* move_apply() is the most likely candidate for causing unwanted and    /* move_apply() is the most likely candidate for causing unwanted and
    * possibly unlimited recursion. */     * possibly unlimited recursion. */
Line 1145
 
Line 1147
   recursion_depth++;    recursion_depth++;
   if (trap->head) trap=trap->head;    if (trap->head) trap=trap->head;
   /* GROS: Handle for plugin close event */    /* GROS: Handle for plugin close event */
   if(trap->event_hook[EVENT_TRIGGER] != NULL)    if ((evt = find_event(trap, EVENT_TRIGGER))!=NULL)
   {    {
     CFParm CFP;      CFParm CFP;
     CFParm* CFR;      CFParm* CFR;
Line 1163
 
Line 1165
     CFP.Value[6] = &m;      CFP.Value[6] = &m;
     CFP.Value[7] = &m;      CFP.Value[7] = &m;
     CFP.Value[8] = &l;      CFP.Value[8] = &l;
     CFP.Value[9] = trap->event_hook[k];      CFP.Value[9] = evt->hook;
     CFP.Value[10]= trap->event_options[k];      CFP.Value[10]= evt->options;
     if (findPlugin(trap->event_plugin[k])>=0)      if (findPlugin(evt->plugin)>=0)
     {      {
       CFR = (PlugList[findPlugin(trap->event_plugin[k])].eventfunc) (&CFP);        CFR = (PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP);
       rtn_script = *(int *)(CFR->Value[0]);        rtn_script = *(int *)(CFR->Value[0]);
       if (rtn_script!=0) return;        if (rtn_script!=0) return;
     }      }
Line 1381
 
Line 1383
 static void apply_book (object *op, object *tmp)  static void apply_book (object *op, object *tmp)
 {  {
     int lev_diff;      int lev_diff;
       event *evt;
   
     if(QUERY_FLAG(op, FLAG_BLIND)&&!QUERY_FLAG(op,FLAG_WIZ)) {      if(QUERY_FLAG(op, FLAG_BLIND)&&!QUERY_FLAG(op,FLAG_WIZ)) {
       new_draw_info(NDI_UNIQUE, 0,op,"You are unable to read while blind.");        new_draw_info(NDI_UNIQUE, 0,op,"You are unable to read while blind.");
Line 1419
 
Line 1422
     new_draw_info_format (NDI_UNIQUE, 0, op,      new_draw_info_format (NDI_UNIQUE, 0, op,
                           "You open the %s and start reading.", tmp->name);                            "You open the %s and start reading.", tmp->name);
     /* GROS: Handle for plugin trigger event */      /* GROS: Handle for plugin trigger event */
     if(tmp->event_hook[EVENT_APPLY] != NULL)      if ((evt = find_event(tmp, EVENT_APPLY)) != NULL)
     {      {
         CFParm CFP;          CFParm CFP;
         int k, l, m;          int k, l, m;
Line 1435
 
Line 1438
         CFP.Value[6] = &m;          CFP.Value[6] = &m;
         CFP.Value[7] = &m;          CFP.Value[7] = &m;
         CFP.Value[8] = &l;          CFP.Value[8] = &l;
         CFP.Value[9] = tmp->event_hook[k];          CFP.Value[9] = evt->hook;
         CFP.Value[10]= tmp->event_options[k];          CFP.Value[10]= evt->options;
         if (findPlugin(tmp->event_plugin[k])>=0)          if (findPlugin(evt->plugin)>=0)
             ((PlugList[findPlugin(tmp->event_plugin[k])].eventfunc) (&CFP));              ((PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP));
     }      }
     else      else
         new_draw_info(NDI_UNIQUE | NDI_NAVY, 0, op, tmp->msg);          new_draw_info(NDI_UNIQUE | NDI_NAVY, 0, op, tmp->msg);
Line 2156
 
Line 2159
 int manual_apply (object *op, object *tmp, int aflag)  int manual_apply (object *op, object *tmp, int aflag)
 {  {
   int rtn_script;    int rtn_script;
     event *evt;
   
   if (tmp->head) tmp=tmp->head;    if (tmp->head) tmp=tmp->head;
   
   if (QUERY_FLAG (tmp, FLAG_UNPAID) && ! QUERY_FLAG (tmp, FLAG_APPLIED)) {    if (QUERY_FLAG (tmp, FLAG_UNPAID) && ! QUERY_FLAG (tmp, FLAG_APPLIED)) {
Line 2172
 
Line 2177
     return 0;      return 0;
      
   /* GROS: Handle for plugin trigger event */    /* GROS: Handle for plugin trigger event */
   if(tmp->event_hook[EVENT_APPLY] != NULL)    if ((evt = find_event(tmp, EVENT_APPLY)) != NULL)
   {    {
     CFParm CFP;      CFParm CFP;
     CFParm* CFR;      CFParm* CFR;
Line 2189
 
Line 2194
     CFP.Value[6] = &m;      CFP.Value[6] = &m;
     CFP.Value[7] = &m;      CFP.Value[7] = &m;
     CFP.Value[8] = &l;      CFP.Value[8] = &l;
     CFP.Value[9] = tmp->event_hook[k];      CFP.Value[9] = evt->hook;
     CFP.Value[10]= tmp->event_options[k];      CFP.Value[10]= evt->options;
     if (findPlugin(tmp->event_plugin[k])>=0)      if (findPlugin(evt->plugin)>=0)
     {      {
         CFR = (PlugList[findPlugin(tmp->event_plugin[k])].eventfunc) (&CFP);          CFR = (PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP);
         rtn_script = *(int *)(CFR->Value[0]);          rtn_script = *(int *)(CFR->Value[0]);
         if (rtn_script!=0) return 1;          if (rtn_script!=0) return 1;
     }      }
Line 2863
 
Line 2868
 {  {
     int basic_flag = aflags & AP_BASIC_FLAGS;      int basic_flag = aflags & AP_BASIC_FLAGS;
     object *tmp, *tmp2;      object *tmp, *tmp2;
       event *evt;
     int i;      int i;
   
     if(who==NULL) {      if(who==NULL) {
Line 2960
 
Line 2966
   
      (void) change_abil (who,op);       (void) change_abil (who,op);
      /* GROS: update the current_weapon_script field (used with EVENT_ATTACK for weapons) */       /* GROS: update the current_weapon_script field (used with EVENT_ATTACK for weapons) */
      if (op->event_hook[EVENT_ATTACK] != NULL) {          if ((evt = find_event(op, EVENT_ATTACK)) != NULL) {
  LOG(llevDebug, "Scripting Weapon wielded\n");   LOG(llevDebug, "Scripting Weapon wielded\n");
  if (who->current_weapon_script) free_string(who->current_weapon_script);   if (who->current_weapon_script) free_string(who->current_weapon_script);
  who->current_weapon_script=add_string(query_name(op));   who->current_weapon_script=add_string(query_name(op));


Legend:
line(s) removed in v.1.83 
line(s) changed
 line(s) added in v.1.84

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:23