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

Comparing deliantra/server/server/time.C (file contents):
Revision 1.32 by elmex, Wed Jan 3 00:56:40 2007 UTC vs.
Revision 1.35 by root, Tue Jan 9 01:28:32 2007 UTC

1/* 1/*
2 CrossFire, A Multiplayer game for X-windows 2 * CrossFire, A Multiplayer game
3 3 *
4 * Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team
4 Copyright (C) 2002 Mark Wedel & Crossfire Development Team 5 * Copyright (C) 2002 Mark Wedel & Crossfire Development Team
5 Copyright (C) 1992 Frank Tore Johansen 6 * Copyright (C) 1992 Frank Tore Johansen
6 7 *
7 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
8 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
9 the Free Software Foundation; either version 2 of the License, or 10 * the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version. 11 * (at your option) any later version.
11 12 *
12 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,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details. 16 * GNU General Public License for more details.
16 17 *
17 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
18 along with this program; if not, write to the Free Software 19 * along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 21 *
21 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>
22*/ 23 */
23 24
24/* 25/*
25 * Routines that is executed from objects based on their speed have been 26 * Routines that is executed from objects based on their speed have been
26 * collected in this file. 27 * collected in this file.
27 */ 28 */
28
29#include <global.h> 29#include <global.h>
30#include <spells.h> 30#include <spells.h>
31#include <sproto.h> 31#include <sproto.h>
32 32
33/* The following removes doors. The functions check to see if similar 33/* The following removes doors. The functions check to see if similar
34 * doors are next to the one that is being removed, and if so, set it 34 * doors are next to the one that is being removed, and if so, set it
35 * so those will be removed shortly (in a cascade like fashion.) 35 * so those will be removed shortly (in a cascade like fashion.)
36 */ 36 */
37
38void 37void
39remove_door (object *op) 38remove_door (object *op)
40{ 39{
41 int i; 40 int i;
42 object *tmp; 41 object *tmp;
1025void 1024void
1026move_player_changer (object *op) 1025move_player_changer (object *op)
1027{ 1026{
1028 object *player; 1027 object *player;
1029 object *walk; 1028 object *walk;
1030 char c;
1031 1029
1032 if (!op->above || !EXIT_PATH (op)) 1030 if (!op->above || !EXIT_PATH (op))
1033 return; 1031 return;
1034 1032
1035 /* This isn't all that great - means that the player_mover 1033 /* This isn't all that great - means that the player_mover
1036 * needs to be on top. 1034 * needs to be on top.
1037 */ 1035 */
1038 if (op->above->type == PLAYER) 1036 if (op->above->type == PLAYER)
1039 { 1037 {
1040 if (INVOKE_OBJECT (TRIGGER, op, ARG_OBJECT (player))) 1038 if (INVOKE_OBJECT (TRIGGER, op, ARG_OBJECT (player)))
1041 return; 1039 return;
1040
1042 player = op->above; 1041 player = op->above;
1043 1042
1044 for (walk = op->inv; walk != NULL; walk = walk->below) 1043 for (walk = op->inv; walk; walk = walk->below)
1045 apply_changes_to_player (player, walk); 1044 apply_changes_to_player (player, walk);
1046 1045
1047 player->update_stats (); 1046 player->update_stats ();
1048 1047
1049 esrv_send_inventory (op->above, op->above); 1048 esrv_send_inventory (op->above, op->above);
1050 esrv_update_item (UPD_FACE, op->above, op->above); 1049 esrv_update_item (UPD_FACE, op->above, op->above);
1051 1050
1052 /* update players death & WoR home-position */ 1051 /* update players death & WoR home-position */
1053 sscanf (EXIT_PATH (op), "%c", &c); 1052 if (*EXIT_PATH (op) == '/')
1054 if (c == '/')
1055 { 1053 {
1056 player->contr->savebed_map = EXIT_PATH (op); 1054 player->contr->savebed_map = EXIT_PATH (op);
1057 player->contr->bed_x = EXIT_X (op); 1055 player->contr->bed_x = EXIT_X (op);
1058 player->contr->bed_y = EXIT_Y (op); 1056 player->contr->bed_y = EXIT_Y (op);
1059 } 1057 }
1060 else 1058 else
1061 LOG (llevDebug, "WARNING: destination '%s' in player_changer must be an absolute path!\n", &EXIT_PATH (op)); 1059 LOG (llevDebug, "WARNING: destination '%s' in player_changer must be an absolute path!\n", &EXIT_PATH (op));
1062 1060
1063 op->above->enter_exit (op); 1061 op->above->enter_exit (op);
1064 player->contr->save ();
1065 } 1062 }
1066} 1063}
1067 1064
1068/* firewalls fire other spells. 1065/* firewalls fire other spells.
1069 * The direction of the wall is stored in op->stats.sp. 1066 * The direction of the wall is stored in op->stats.sp.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines