1 | /* |
1 | /* |
2 | CrossFire, A Multiplayer game for X-windows |
2 | * CrossFire, A Multiplayer game for X-windows |
3 | |
3 | * |
4 | Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
4 | * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
5 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
5 | * Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
6 | Copyright (C) 1992 Frank Tore Johansen |
6 | * Copyright (C) 1992 Frank Tore Johansen |
7 | |
7 | * |
8 | This program is free software; you can redistribute it and/or modify |
8 | * This program is free software; you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
10 | the Free Software Foundation; either version 2 of the License, or |
10 | * the Free Software Foundation; either version 2 of the License, or |
11 | (at your option) any later version. |
11 | * (at your option) any later version. |
12 | |
12 | * |
13 | This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
16 | * GNU General Public License for more details. |
17 | |
17 | * |
18 | You should have received a copy of the GNU General Public License |
18 | * You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
19 | * along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
21 | |
21 | * |
22 | The authors can be reached via e-mail at <crossfire@schmorp.de> |
22 | * The authors can be reached via e-mail at <crossfire@schmorp.de> |
23 | */ |
23 | */ |
24 | |
24 | |
25 | /* Eneq(@csd.uu.se): Added weight-modifiers in environment of objects. |
25 | /* Eneq(@csd.uu.se): Added weight-modifiers in environment of objects. |
26 | sub/add_weight will transcend the environment updating the carrying |
26 | sub/add_weight will transcend the environment updating the carrying |
27 | variable. */ |
27 | variable. */ |
28 | |
28 | |
… | |
… | |
630 | if (!str) |
630 | if (!str) |
631 | { |
631 | { |
632 | op->animation_id = 0; |
632 | op->animation_id = 0; |
633 | CLEAR_FLAG (op, FLAG_ANIMATE); |
633 | CLEAR_FLAG (op, FLAG_ANIMATE); |
634 | } |
634 | } |
635 | else |
|
|
636 | { |
|
|
637 | op->animation_id = find_animation (str); |
635 | else if ((op->animation_id = find_animation (str))) |
638 | SET_FLAG (op, FLAG_ANIMATE); |
636 | SET_FLAG (op, FLAG_ANIMATE); |
639 | } |
|
|
640 | } |
637 | } |
641 | |
638 | |
642 | break; |
639 | break; |
643 | |
640 | |
644 | case KW_last_heal: thawer.get (op->last_heal); break; |
641 | case KW_last_heal: thawer.get (op->last_heal); break; |
… | |
… | |
651 | thawer.get (op->speed); |
648 | thawer.get (op->speed); |
652 | |
649 | |
653 | //TODO: maybe do in check_object |
650 | //TODO: maybe do in check_object |
654 | // removed check for style maps |
651 | // removed check for style maps |
655 | if (op->speed < 0) |
652 | if (op->speed < 0) |
656 | op->speed_left = op->speed_left - RANDOM () % 100 / 100.0; |
653 | op->speed_left = op->speed_left - rndm (); |
657 | |
654 | |
658 | break; |
655 | break; |
659 | |
656 | |
660 | case KW_slow_move: |
657 | case KW_slow_move: |
661 | op->move_slow |= MOVE_WALK; |
658 | op->move_slow |= MOVE_WALK; |
… | |
… | |
1277 | KW_use_content_on_gen, |
1274 | KW_use_content_on_gen, |
1278 | KW_NULL, |
1275 | KW_NULL, |
1279 | KW_is_buildable, |
1276 | KW_is_buildable, |
1280 | /* 110 */ |
1277 | /* 110 */ |
1281 | KW_destroy_on_death, |
1278 | KW_destroy_on_death, |
|
|
1279 | KW_NULL, |
1282 | }; |
1280 | }; |
1283 | |
1281 | |
1284 | int i; |
1282 | int i; |
1285 | |
1283 | |
1286 | /* This saves the key/value lists. We do it first so that any |
1284 | /* This saves the key/value lists. We do it first so that any |
1287 | * keys that match field names will be overwritten by the loader. |
1285 | * keys that match field names will be overwritten by the loader. |
1288 | */ |
1286 | */ |
1289 | for (key_value *my_field = op->key_values; my_field != NULL; my_field = my_field->next) |
1287 | for (key_value *my_field = op->key_values; my_field; my_field = my_field->next) |
1290 | { |
1288 | { |
1291 | /* Find the field in the opposing member. */ |
1289 | /* Find the field in the opposing member. */ |
1292 | key_value *arch_field = get_ob_key_link (tmp, my_field->key); |
1290 | key_value *arch_field = get_ob_key_link (tmp, my_field->key); |
1293 | |
1291 | |
1294 | /* If there's no partnering field, or it's got a different value, save our field. */ |
1292 | /* If there's no partnering field, or it's got a different value, save our field. */ |