Ignore:
Timestamp:
Apr 17, 2011, 10:28:28 AM (11 years ago)
Author:
Sam Hocevar
Message:

lisp: implement LispNumber::Create.

File:
1 edited

Legend:

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

    r484 r486  
    228228  p_ref r1(list);
    229229  push_onto_list(new_lisp_pointer(target),list);
    230   push_onto_list(new_lisp_number(angle),list);
    231   push_onto_list(new_lisp_number(y2),list);
    232   push_onto_list(new_lisp_number(x2),list);
    233   push_onto_list(new_lisp_number(type),list);
     230  push_onto_list(LispNumber::Create(angle),list);
     231  push_onto_list(LispNumber::Create(y2),list);
     232  push_onto_list(LispNumber::Create(x2),list);
     233  push_onto_list(LispNumber::Create(type),list);
    234234  push_onto_list(new_lisp_pointer(o->get_object(0)),list);
    235235  eval_function((LispSymbol *)l_fire_object,list);
     
    260260    o->lvars[fire_delay1]=3;
    261261    if (player_fire_weapon(o,SHOTGUN,NULL,o->lvars[point_angle],small_fire_off))
    262           ret=new_lisp_number(-1);
    263     else ret=new_lisp_number(0);
     262          ret=LispNumber::Create(-1);
     263    else ret=LispNumber::Create(0);
    264264      } else
    265265      {
    266266    o->lvars[fire_delay1]=5;                  // no ammo, set large fire delay for next shot
    267267    player_fire_weapon(o,SHOTGUN,NULL,o->lvars[point_angle],small_fire_off);
    268     ret=new_lisp_number(0);
     268    ret=LispNumber::Create(0);
    269269      }
    270     } else ret=new_lisp_number(0);                // can't fire yet, return 0 ammo subtract
     270    } else ret=LispNumber::Create(0);                // can't fire yet, return 0 ammo subtract
    271271  }
    272272  return ret;
     
    303303    if (player_fire_weapon(o,ammo_type(o->otype),NULL,o->lvars[point_angle],
    304304                   o->otype==DFRIS ? large_fire_off : small_fire_off ))   
    305           ret=new_lisp_number(-1);
    306     else ret=new_lisp_number(0);
    307       } else ret=new_lisp_number(0);
    308     } else ret=new_lisp_number(0);                // can't fire yet, return 0 ammo subtract
     305          ret=LispNumber::Create(-1);
     306    else ret=LispNumber::Create(0);
     307      } else ret=LispNumber::Create(0);
     308    } else ret=LispNumber::Create(0);                // can't fire yet, return 0 ammo subtract
    309309  }
    310310  return ret;
     
    329329    o->lvars[fire_delay1]=2;
    330330    if (player_fire_weapon(o,PLASMA,NULL,o->lvars[point_angle],small_fire_off))   
    331           ret=new_lisp_number(-1);
    332     else ret=new_lisp_number(0);
    333       } else ret=new_lisp_number(0);
    334     } else ret=new_lisp_number(0);                // can't fire yet, return 0 ammo subtract
     331          ret=LispNumber::Create(-1);
     332    else ret=LispNumber::Create(0);
     333      } else ret=LispNumber::Create(0);
     334    } else ret=LispNumber::Create(0);                // can't fire yet, return 0 ammo subtract
    335335  }
    336336  return ret;
     
    354354    if (player_fire_weapon(o,LSABER,NULL,o->lvars[point_angle]+(current_level->tick_counter()&7)-8,
    355355                   small_fire_off))
    356           ret=new_lisp_number(-1);
    357     else ret=new_lisp_number(0);
    358       } else ret=new_lisp_number(0);
    359     } else ret=new_lisp_number(0);                // can't fire yet, return 0 ammo subtract
     356          ret=LispNumber::Create(-1);
     357    else ret=LispNumber::Create(0);
     358      } else ret=LispNumber::Create(0);
     359    } else ret=LispNumber::Create(0);                // can't fire yet, return 0 ammo subtract
    360360  }
    361361  return ret;
     
    403403    }
    404404    if (player_fire_weapon(o,ROCKET,target,o->lvars[point_angle],large_fire_off))   
    405           ret=new_lisp_number(-1);
    406     else ret=new_lisp_number(0);
    407 
    408       } else ret=new_lisp_number(0);
    409     } else ret=new_lisp_number(0);                // can't fire yet, return 0 ammo subtract
     405          ret=LispNumber::Create(-1);
     406    else ret=LispNumber::Create(0);
     407
     408      } else ret=LispNumber::Create(0);
     409    } else ret=LispNumber::Create(0);                // can't fire yet, return 0 ammo subtract
    410410  }
    411411  return ret;
     
    658658      view *v=o->controller();
    659659
    660       push_onto_list(new_lisp_number(v->weapon_total(v->current_weapon)),args);
     660      push_onto_list(LispNumber::Create(v->weapon_total(v->current_weapon)),args);
    661661      push_onto_list(l_FIRE,args);
    662662
     
    681681  }
    682682
    683   return new_lisp_number(ret);
     683  return LispNumber::Create(ret);
    684684}
    685685
     
    755755      p_ref r1(ret);
    756756
    757       push_onto_list(new_lisp_number(bot->get_tint()),ret);
     757      push_onto_list(LispNumber::Create(bot->get_tint()),ret);
    758758
    759759      if (bot->lvars[special_power]==SNEAKY_POWER)
Note: See TracChangeset for help on using the changeset viewer.