version 1.125 | | version 1.126 |
---|
| | |
/* | | /* |
* static char *rcsid_player_c = | | * static char *rcsid_player_c = |
* "$Id: player.c,v 1.125 2003/03/08 05:35:32 mwedel Exp $"; | | * "$Id: player.c,v 1.126 2003/03/19 08:04:52 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
} | | } |
| | |
int move_player(object *op,int dir) { | | int move_player(object *op,int dir) { |
int face, pick; | | int pick; |
| | |
if(op->contr->socket.newanim) | | |
face = dir%8; | | |
else | | |
face = dir ? (dir - 1) / 2 : -1; | | |
| | |
if(op->map == NULL || op->map->in_memory != MAP_IN_MEMORY) | | if(op->map == NULL || op->map->in_memory != MAP_IN_MEMORY) |
return 0; | | return 0; |
| | |
/* peterm: added following line */ | | /* peterm: added following line */ |
op->facing = dir; | | |
if(QUERY_FLAG(op,FLAG_CONFUSED) && dir) | | if(QUERY_FLAG(op,FLAG_CONFUSED) && dir) |
dir = absdir(dir + RANDOM()%3 + RANDOM()%3 - 2); | | dir = absdir(dir + RANDOM()%3 + RANDOM()%3 - 2); |
| | |
| | op->facing = dir; |
| | |
if(op->hide) do_hidden_move(op); | | if(op->hide) do_hidden_move(op); |
| | |
if(op->contr->fire_on) { | | if(op->contr->fire_on) { |
| | |
} | | } |
else move_player_attack(op,dir); | | else move_player_attack(op,dir); |
| | |
| | pick = check_pick(op); |
| | |
| | |
/* Add special check for newcs players and fire on - this way, the | | /* Add special check for newcs players and fire on - this way, the |
* server can handle repeat firing. | | * server can handle repeat firing. |
*/ | | */ |
pick = check_pick(op); | | |
if (op->contr->fire_on || (op->contr->run_on && pick!=0)) { | | if (op->contr->fire_on || (op->contr->run_on && pick!=0)) { |
op->direction = dir; | | op->direction = dir; |
} else { | | } else { |
op->direction=0; | | op->direction=0; |
} | | } |
| | /* Update how the player looks. Use the facing, so direction may |
if(face != -1) | | * get reset to zero. This allows for full animation capabilities |
SET_ANIMATION(op,face); | | * for players. |
| | */ |
update_object(op, UP_OBJ_FACE); | | animate_object(op, op->facing); |
| | |
return 0; | | return 0; |
} | | } |
| | |