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.72 by root, Thu Nov 8 19:43:29 2007 UTC vs.
Revision 1.75 by root, Sun May 4 08:25:33 2008 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 Frank Tore Johansen 6 * Copyright (©) 1992,2007 Frank Tore Johansen
7 * 7 *
8 * Deliantra is free software: you can redistribute it and/or modify 8 * Deliantra 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
117 117
118 dir = find_free_spot (op, gen->map, gen->x, gen->y, 1, SIZEOFFREE1 + 1); 118 dir = find_free_spot (op, gen->map, gen->x, gen->y, 1, SIZEOFFREE1 + 1);
119 if (dir < 0) 119 if (dir < 0)
120 return; 120 return;
121 121
122 op = object_create_clone (op); 122 op = op->deep_clone ();
123 123
124 CLEAR_FLAG (op, FLAG_IS_A_TEMPLATE); 124 CLEAR_FLAG (op, FLAG_IS_A_TEMPLATE);
125 unflag_inv (op, FLAG_IS_A_TEMPLATE); 125 unflag_inv (op, FLAG_IS_A_TEMPLATE);
126 } 126 }
127 else if (gen->other_arch) 127 else if (gen->other_arch)
857 857
858 if (op->type == LAMP) 858 if (op->type == LAMP)
859 tmp->stats.food = op->stats.food - 1; 859 tmp->stats.food = op->stats.food - 1;
860 860
861 tmp->stats.hp = op->stats.hp; /* The only variable it keeps. */ 861 tmp->stats.hp = op->stats.hp; /* The only variable it keeps. */
862
862 if (env) 863 if (env)
863 {
864 tmp = env->insert (tmp); 864 env->insert (tmp);
865
866 /* If this object is the players inventory, we need to tell the
867 * client of the change. Insert_ob_in_map takes care of the
868 * updating the client, so we don't need to do that below.
869 */
870 if (object *pl = op->in_player ())
871 {
872 esrv_del_item (pl->contr, op->count);
873 esrv_send_item (pl, tmp);
874 }
875 }
876 else 865 else
877 { 866 {
878 j = find_first_free_spot (tmp, op->map, op->x, op->y); 867 j = find_first_free_spot (tmp, op->map, op->x, op->y);
879 if (j < 0) /* No free spot */ 868 if (j < 0) /* No free spot */
880 tmp->destroy (); 869 tmp->destroy ();
1191 if (rndm (0, i) == 0) 1180 if (rndm (0, i) == 0)
1192 { 1181 {
1193 ob_to_copy = ob; 1182 ob_to_copy = ob;
1194 } 1183 }
1195 } 1184 }
1196 new_ob = object_create_clone (ob_to_copy); 1185 new_ob = ob_to_copy->deep_clone ();
1197 CLEAR_FLAG (new_ob, FLAG_IS_A_TEMPLATE); 1186 CLEAR_FLAG (new_ob, FLAG_IS_A_TEMPLATE);
1198 unflag_inv (new_ob, FLAG_IS_A_TEMPLATE); 1187 unflag_inv (new_ob, FLAG_IS_A_TEMPLATE);
1199 } 1188 }
1200 else 1189 else
1201 { 1190 {
1310 { 1299 {
1311 if (QUERY_FLAG (op, FLAG_APPLIED)) 1300 if (QUERY_FLAG (op, FLAG_APPLIED))
1312 remove_force (op); 1301 remove_force (op);
1313 else 1302 else
1314 { 1303 {
1315 /* If necessary, delete the item from the players inventory */
1316 if (object *pl = op->in_player ())
1317 esrv_del_item (pl->contr, op->count);
1318
1319 op->remove (); 1304 op->remove ();
1320 1305
1321 if (QUERY_FLAG (op, FLAG_SEE_ANYWHERE)) 1306 if (QUERY_FLAG (op, FLAG_SEE_ANYWHERE))
1322 make_sure_not_seen (op); 1307 make_sure_not_seen (op);
1323 1308

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines