ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/c_move.C
Revision: 1.11
Committed: Sun Jul 1 05:00:19 2007 UTC (16 years, 11 months ago) by root
Content type: text/plain
Branch: MAIN
CVS Tags: rel-2_2, rel-2_3
Changes since 1.10: +10 -11 lines
Log Message:
- upgrade crossfire trt to the GPL version 3 (hopefully correctly).
- add a single file covered by the GNU Affero General Public License
  (which is not yet released, so I used the current draft, which is
  legally a bit wavy, but its likely better than nothing as it expresses
  direct intent by the authors, and we can upgrade as soon as it has been
  released).
  * this should ensure availability of source code for the server at least
    and hopefully also archetypes and maps even when modified versions
    are not being distributed, in accordance of section 13 of the agplv3.

File Contents

# User Rev Content
1 elmex 1.1 /*
2 root 1.10 * This file is part of Crossfire TRT, the Roguelike Realtime MORPG.
3 pippijn 1.7 *
4 root 1.10 * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team
5     * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
6     * Copyright (©) 1992,2007 Frank Tore Johansen
7 pippijn 1.7 *
8 root 1.11 * Crossfire TRT is free software: you can redistribute it and/or modify
9     * it under the terms of the GNU General Public License as published by
10     * the Free Software Foundation, either version 3 of the License, or
11     * (at your option) any later version.
12 pippijn 1.7 *
13 root 1.11 * This program is distributed in the hope that it will be useful,
14     * but WITHOUT ANY WARRANTY; without even the implied warranty of
15     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16     * GNU General Public License for more details.
17 pippijn 1.7 *
18 root 1.11 * You should have received a copy of the GNU General Public License
19     * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 root 1.10 *
21     * The authors can be reached via e-mail to <crossfire@schmorp.de>
22 pippijn 1.7 */
23 elmex 1.1
24     #include <global.h>
25 root 1.5 #include <sproto.h>
26 elmex 1.1 #include <skills.h>
27    
28 root 1.3 static int
29     move_internal (object *op, char *params, int dir)
30 elmex 1.1 {
31 root 1.3 if (params)
32     {
33     if (params[0] == 'f')
34     {
35     if (!op->contr->fire_on)
36     {
37     op->contr->fire_on = 1;
38     move_player (op, dir);
39     op->contr->fire_on = 0;
40     return 0;
41     }
42     }
43     else if (params[0] == 'r' && !op->contr->run_on)
44     op->contr->run_on = 1;
45     }
46 root 1.9
47 root 1.3 move_player (op, dir);
48 elmex 1.1 return 0;
49     }
50    
51 root 1.3 int
52     command_east (object *op, char *params)
53 elmex 1.1 {
54 root 1.3 return move_internal (op, params, 3);
55 elmex 1.1 }
56    
57 root 1.3 int
58     command_north (object *op, char *params)
59 elmex 1.1 {
60 root 1.3 return move_internal (op, params, 1);
61 elmex 1.1 }
62    
63 root 1.3 int
64     command_northeast (object *op, char *params)
65 elmex 1.1 {
66 root 1.3 return move_internal (op, params, 2);
67 elmex 1.1 }
68    
69 root 1.3 int
70     command_northwest (object *op, char *params)
71 elmex 1.1 {
72 root 1.3 return move_internal (op, params, 8);
73 elmex 1.1 }
74    
75 root 1.3 int
76     command_south (object *op, char *params)
77 elmex 1.1 {
78 root 1.3 return move_internal (op, params, 5);
79 elmex 1.1 }
80    
81 root 1.3 int
82     command_southeast (object *op, char *params)
83 elmex 1.1 {
84 root 1.3 return move_internal (op, params, 4);
85 elmex 1.1 }
86    
87 root 1.3 int
88     command_southwest (object *op, char *params)
89 elmex 1.1 {
90 root 1.3 return move_internal (op, params, 6);
91 elmex 1.1 }
92    
93 root 1.3 int
94     command_west (object *op, char *params)
95 elmex 1.1 {
96 root 1.3 return move_internal (op, params, 7);
97 elmex 1.1 }
98    
99 pippijn 1.8 // XXX: What does this do?
100 root 1.3 int
101     command_stay (object *op, char *params)
102 elmex 1.1 {
103     if (!op->contr->fire_on && (!params || params[0] != 'f'))
104     return 0;
105 root 1.3 fire (op, 0);
106 elmex 1.1 return 0;
107     }