Ignore:
Timestamp:
Nov 10, 2005, 8:08:09 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • shitloads of long -> int32_t changes for 64 bit safety.
File:
1 edited

Legend:

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

    r2 r16  
    1717void *ant_ai();
    1818
    19 int can_see(game_object *o, long x1, long y1, long x2, long y2)
    20 {
    21   long nx2=x2,ny2=y2;
     19int can_see(game_object *o, int32_t x1, int32_t y1, int32_t x2, int32_t y2)
     20{
     21  int32_t nx2=x2,ny2=y2;
    2222  current_level->foreground_intersect(x1,y1,x2,y2);
    2323  if (x2!=nx2 || y2!=ny2) return 0;
     
    9595static void fire_at_player(game_object *o, game_object *b)
    9696{
    97   long firex=o->x+(o->direction>0?15:-15),firey=o->y-15,
    98        playerx=b->x+b->xvel()*8,playery=b->y-15+b->yvel()*2;
     97  int32_t firex=o->x+(o->direction>0?15:-15),firey=o->y-15,
     98          playerx=b->x+b->xvel()*8,playery=b->y-15+b->yvel()*2;
    9999  if (can_see(o,o->x,o->y,firex,firey) && can_see(o,firex,firey,playerx,playery))
    100100  {
     
    224224      if (!o->next_picture())
    225225      {
    226         long xv=0,yv=2;
     226        int32_t xv=0,yv=2;
    227227        o->try_move(o->x,o->y,xv,yv,1);
    228228        if (yv!=0)
     
    264264          else
    265265          {
    266             long xm=o->direction>0 ? get_ability(o->otype,run_top_speed) : -get_ability(o->otype,run_top_speed);
    267             long ym=0,new_xm=xm;
     266            int32_t xm=o->direction>0 ? get_ability(o->otype,run_top_speed) : -get_ability(o->otype,run_top_speed);
     267            int32_t ym=0,new_xm=xm;
    268268            if (o->state!=running) o->set_state(running);
    269269
     
    349349//      o->set_yvel(o->yvel()+1);
    350350      o->set_xacel(0);
    351       long xv=0,yv=o->yvel();
     351      int32_t xv=0,yv=o->yvel();
    352352      o->y-=31;
    353353      o->try_move(o->x,o->y,xv,yv,1);
Note: See TracChangeset for help on using the changeset viewer.