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

Comparing deliantra/server/server/login.C (file contents):
Revision 1.32 by root, Sat Dec 23 06:21:02 2006 UTC vs.
Revision 1.35 by root, Mon Dec 25 17:11:17 2006 UTC

35 * keep the game running. Thus, we don't want to free any information. 35 * keep the game running. Thus, we don't want to free any information.
36 */ 36 */
37void 37void
38emergency_save (int flag) 38emergency_save (int flag)
39{ 39{
40 player *pl;
41
42 trying_emergency_save = 1; 40 trying_emergency_save = 1;
43 41
44 LOG (llevError, "Emergency save: "); 42 LOG (llevError, "Emergency save: ");
45 for (pl = first_player; pl; pl = pl->next) 43 for_all_players (pl)
46 { 44 {
47 if (!pl->ob) 45 if (!pl->ob)
48 { 46 {
49 LOG (llevError, "No name, ignoring this.\n"); 47 LOG (llevError, "No name, ignoring this.\n");
50 continue; 48 continue;
133 131
134 INVOKE_PLAYER (SAVE, ob->contr); 132 INVOKE_PLAYER (SAVE, ob->contr);
135 133
136 object_freezer freezer; 134 object_freezer freezer;
137 135
138 int wiz = ob->flags [FLAG_WIZ]; 136 int wiz = ob->flag [FLAG_WIZ];
139 137
140 /* Eneq(@csd.uu.se): If we have an open container hide it. */ 138 /* Eneq(@csd.uu.se): If we have an open container hide it. */
141 container = ob->container; 139 container = ob->container;
142 ob->container = 0; 140 ob->container = 0;
143 141
194 192
195 fprintf (freezer, "endplst\n"); 193 fprintf (freezer, "endplst\n");
196 194
197 SET_FLAG (ob, FLAG_NO_FIX_PLAYER); 195 SET_FLAG (ob, FLAG_NO_FIX_PLAYER);
198 CLEAR_FLAG (ob, FLAG_WIZ); 196 CLEAR_FLAG (ob, FLAG_WIZ);
199 save_object (freezer, ob, 3); /* don't check and don't remove */ 197 save_object (freezer, ob, 1); /* don't check and don't remove */
200 198
201 char filename[MAX_BUF]; 199 char filename[MAX_BUF];
202 200
203 sprintf (filename, "%s/%s/%s/%s.pl", settings.localdir, settings.playerdir, &ob->name, &ob->name); 201 sprintf (filename, "%s/%s/%s/%s.pl", settings.localdir, settings.playerdir, &ob->name, &ob->name);
204 make_path_to_file (filename); 202 make_path_to_file (filename);
207 CLEAR_FLAG (ob, FLAG_NO_FIX_PLAYER); 205 CLEAR_FLAG (ob, FLAG_NO_FIX_PLAYER);
208 206
209 /* Eneq(@csd.uu.se): Reveal the container if we have one. */ 207 /* Eneq(@csd.uu.se): Reveal the container if we have one. */
210 ob->container = container; 208 ob->container = container;
211 209
212 ob->flags [FLAG_WIZ] = wiz; 210 ob->flag [FLAG_WIZ] = wiz;
213 211
214 enable_save = !final; 212 enable_save = !final;
215} 213}
216 214
217player * 215player *

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines