Ignore:
Timestamp:
Apr 17, 2011, 11:56:59 PM (10 years ago)
Author:
Sam Hocevar
Message:

lisp: implement LSymbol::EvalFunction? and ensure all local pointers are
protected against collection.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/cop.cpp

    r496 r497  
    234234  push_onto_list(LNumber::Create(type),list);
    235235  push_onto_list(LPointer::Create(o->get_object(0)),list);
    236   eval_function((LSymbol *)l_fire_object,list);
     236  ((LSymbol *)l_fire_object)->EvalFunction(list);
    237237  o->lvars[top_just_fired]=1;
    238238  other->lvars[just_fired]=1;
     
    663663
    664664      current_object=top;
    665       void *ret=eval_function((LSymbol *)figures[top->otype]->get_fun(OFUN_USER_FUN),args);
     665      void *ret = ((LSymbol *)figures[top->otype]->get_fun(OFUN_USER_FUN))->EvalFunction(args);
    666666      current_object=o;
    667667      v->add_ammo(v->current_weapon,lnumber_value(ret));
     
    673673      {
    674674        // call the user function to reset the player
    675     eval_function((LSymbol *)l_restart_player,NULL);
     675    ((LSymbol *)l_restart_player)->EvalFunction(NULL);
    676676    o->controller()->reset_player();
    677677    o->set_aistate(0);
     
    767767      o->draw_predator();
    768768      } else
    769         eval_function((LSymbol *)l_player_draw,ret);
     769        ((LSymbol *)l_player_draw)->EvalFunction(ret);
    770770
    771771      o->y=oldy;
     
    830830      case FAST_POWER :
    831831      {
    832     eval_function((LSymbol *)l_draw_fast,NULL);
     832    ((LSymbol *)l_draw_fast)->EvalFunction(NULL);
    833833    int old_state=o->state;
    834834    switch (o->state)
Note: See TracChangeset for help on using the changeset viewer.