1 | |
|
|
2 | /* |
|
|
3 | * static char *rcsid_time_c = |
|
|
4 | * "$Id: time.C,v 1.11 2006/09/14 01:12:28 root Exp $"; |
|
|
5 | */ |
|
|
6 | |
|
|
7 | /* |
1 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
2 | CrossFire, A Multiplayer game for X-windows |
9 | |
3 | |
10 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
4 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
11 | Copyright (C) 1992 Frank Tore Johansen |
5 | Copyright (C) 1992 Frank Tore Johansen |
… | |
… | |
22 | |
16 | |
23 | You should have received a copy of the GNU General Public License |
17 | You should have received a copy of the GNU General Public License |
24 | along with this program; if not, write to the Free Software |
18 | along with this program; if not, write to the Free Software |
25 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
26 | |
20 | |
27 | The authors can be reached via e-mail at crossfire-devel@real-time.com |
21 | The authors can be reached via e-mail at <crossfire@schmorp.de> |
28 | */ |
22 | */ |
29 | |
23 | |
30 | /* |
24 | /* |
31 | * Routines that is executed from objects based on their speed have been |
25 | * Routines that is executed from objects based on their speed have been |
32 | * collected in this file. |
26 | * collected in this file. |
… | |
… | |
621 | * Inserts item into the old map, or merges it if it already is on the map. |
615 | * Inserts item into the old map, or merges it if it already is on the map. |
622 | * |
616 | * |
623 | * 'map' must be the value of op->map before stop_item() was called. |
617 | * 'map' must be the value of op->map before stop_item() was called. |
624 | */ |
618 | */ |
625 | void |
619 | void |
626 | fix_stopped_item (object *op, mapstruct *map, object *originator) |
620 | fix_stopped_item (object *op, maptile *map, object *originator) |
627 | { |
621 | { |
628 | if (map == NULL) |
622 | if (map == NULL) |
629 | return; |
623 | return; |
630 | if (QUERY_FLAG (op, FLAG_REMOVED)) |
624 | if (QUERY_FLAG (op, FLAG_REMOVED)) |
631 | insert_ob_in_map (op, map, originator, 0); |
625 | insert_ob_in_map (op, map, originator, 0); |
… | |
… | |
716 | move_arrow (object *op) |
710 | move_arrow (object *op) |
717 | { |
711 | { |
718 | object *tmp; |
712 | object *tmp; |
719 | sint16 new_x, new_y; |
713 | sint16 new_x, new_y; |
720 | int was_reflected, mflags; |
714 | int was_reflected, mflags; |
721 | mapstruct *m; |
715 | maptile *m; |
722 | |
716 | |
723 | if (op->map == NULL) |
717 | if (op->map == NULL) |
724 | { |
718 | { |
725 | LOG (llevError, "BUG: Arrow had no map.\n"); |
719 | LOG (llevError, "BUG: Arrow had no map.\n"); |
726 | remove_ob (op); |
720 | remove_ob (op); |
… | |
… | |
849 | * that did the same thing. |
843 | * that did the same thing. |
850 | */ |
844 | */ |
851 | while (retry < 2) |
845 | while (retry < 2) |
852 | { |
846 | { |
853 | int left, right, mflags; |
847 | int left, right, mflags; |
854 | mapstruct *m1; |
848 | maptile *m1; |
855 | sint16 x1, y1; |
849 | sint16 x1, y1; |
856 | |
850 | |
857 | retry++; |
851 | retry++; |
858 | |
852 | |
859 | /* Need to check for P_OUT_OF_MAP: if the arrow is tavelling |
853 | /* Need to check for P_OUT_OF_MAP: if the arrow is tavelling |
… | |
… | |
1122 | move_player_mover (object *op) |
1116 | move_player_mover (object *op) |
1123 | { |
1117 | { |
1124 | object *victim, *nextmover; |
1118 | object *victim, *nextmover; |
1125 | int dir = op->stats.sp; |
1119 | int dir = op->stats.sp; |
1126 | sint16 nx, ny; |
1120 | sint16 nx, ny; |
1127 | mapstruct *m; |
1121 | maptile *m; |
1128 | |
1122 | |
1129 | /* Determine direction now for random movers so we do the right thing */ |
1123 | /* Determine direction now for random movers so we do the right thing */ |
1130 | if (!dir) |
1124 | if (!dir) |
1131 | dir = rndm (1, 8); |
1125 | dir = rndm (1, 8); |
1132 | |
1126 | |