ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/c_move.C
(Generate patch)

Comparing deliantra/server/server/c_move.C (file contents):
Revision 1.2 by root, Tue Aug 29 08:01:37 2006 UTC vs.
Revision 1.3 by root, Sun Sep 10 15:59:57 2006 UTC

1
1/* 2/*
2 * static char *rcsid_c_move_c = 3 * static char *rcsid_c_move_c =
3 * "$Id: c_move.C,v 1.2 2006/08/29 08:01:37 root Exp $"; 4 * "$Id: c_move.C,v 1.3 2006/09/10 15:59:57 root Exp $";
4 */ 5 */
5 6
6/* 7/*
7 CrossFire, A Multiplayer game for X-windows 8 CrossFire, A Multiplayer game for X-windows
8 9
26 The author can be reached via e-mail to crossfire-devel@real-time.com 27 The author can be reached via e-mail to crossfire-devel@real-time.com
27*/ 28*/
28 29
29#include <global.h> 30#include <global.h>
30#ifndef __CEXTRACT__ 31#ifndef __CEXTRACT__
31#include <sproto.h> 32# include <sproto.h>
32#endif 33#endif
33#include <skills.h> 34#include <skills.h>
34 35
36static int
35static int move_internal (object *op, char *params, int dir) 37move_internal (object *op, char *params, int dir)
36{ 38{
37 if (params) { 39 if (params)
40 {
38 if (params[0] == 'f') { 41 if (params[0] == 'f')
42 {
39 if (!op->contr->fire_on) { 43 if (!op->contr->fire_on)
44 {
40 op->contr->fire_on =1; 45 op->contr->fire_on = 1;
41 move_player(op, dir); 46 move_player (op, dir);
42 op->contr->fire_on =0; 47 op->contr->fire_on = 0;
43 return 0; 48 return 0;
49 }
44 } 50 }
45 } else if (params[0] == 'r' && !op->contr->run_on) 51 else if (params[0] == 'r' && !op->contr->run_on)
46 op->contr->run_on =1; 52 op->contr->run_on = 1;
47 } 53 }
48 move_player(op, dir); 54 move_player (op, dir);
49 return 0; 55 return 0;
50} 56}
51 57
58int
52int command_east (object *op, char *params) 59command_east (object *op, char *params)
53{ 60{
54 return move_internal(op, params, 3); 61 return move_internal (op, params, 3);
55} 62}
56 63
64int
57int command_north (object *op, char *params) 65command_north (object *op, char *params)
58{ 66{
59 return move_internal(op, params, 1); 67 return move_internal (op, params, 1);
60} 68}
61 69
70int
62int command_northeast (object *op, char *params) 71command_northeast (object *op, char *params)
63{ 72{
64 return move_internal(op, params, 2); 73 return move_internal (op, params, 2);
65} 74}
66 75
76int
67int command_northwest (object *op, char *params) 77command_northwest (object *op, char *params)
68{ 78{
69 return move_internal(op, params, 8); 79 return move_internal (op, params, 8);
70} 80}
71 81
82int
72int command_south (object *op, char *params) 83command_south (object *op, char *params)
73{ 84{
74 return move_internal(op, params, 5); 85 return move_internal (op, params, 5);
75} 86}
76 87
88int
77int command_southeast (object *op, char *params) 89command_southeast (object *op, char *params)
78{ 90{
79 return move_internal(op, params, 4); 91 return move_internal (op, params, 4);
80} 92}
81 93
94int
82int command_southwest (object *op, char *params) 95command_southwest (object *op, char *params)
83{ 96{
84 return move_internal(op, params, 6); 97 return move_internal (op, params, 6);
85} 98}
86 99
100int
87int command_west (object *op, char *params) 101command_west (object *op, char *params)
88{ 102{
89 return move_internal(op, params, 7); 103 return move_internal (op, params, 7);
90} 104}
91 105
106int
92int command_stay (object *op, char *params) 107command_stay (object *op, char *params)
93{ 108{
94 if (!op->contr->fire_on && (!params || params[0] != 'f')) 109 if (!op->contr->fire_on && (!params || params[0] != 'f'))
95 return 0; 110 return 0;
96 fire(op, 0); 111 fire (op, 0);
97 return 0; 112 return 0;
98} 113}
99
100

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines