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

Comparing deliantra/server/server/player.C (file contents):
Revision 1.92 by root, Mon Jan 8 01:19:04 2007 UTC vs.
Revision 1.96 by root, Mon Jan 8 19:25:53 2007 UTC

211player::connect (client *ns) 211player::connect (client *ns)
212{ 212{
213 this->ns = ns; 213 this->ns = ns;
214 ns->pl = this; 214 ns->pl = this;
215 215
216 run_on = 0;
217 fire_on = 0;
218
216 ns->update_look = 0; 219 ns->update_look = 0;
217 ns->look_position = 0; 220 ns->look_position = 0;
218 221
219 clear_los (ob); 222 clear_los (ob);
223
224 ns->reset_stats ();
220 225
221 /* make sure he's a player -- needed because of class change. */ 226 /* make sure he's a player -- needed because of class change. */
222 ob->type = PLAYER; // we are paranoid 227 ob->type = PLAYER; // we are paranoid
223 ob->race = ob->arch->clone.race; 228 ob->race = ob->arch->clone.race;
224 229
324 unapply = unapply_nochoice; 329 unapply = unapply_nochoice;
325 330
326 savebed_map = first_map_path; /* Init. respawn position */ 331 savebed_map = first_map_path; /* Init. respawn position */
327 332
328 gen_sp_armour = 10; 333 gen_sp_armour = 10;
329 last_speed = -1;
330 shoottype = range_none; 334 shoottype = range_none;
331 bowtype = bow_normal; 335 bowtype = bow_normal;
332 petmode = pet_normal; 336 petmode = pet_normal;
333 listening = 10; 337 listening = 10;
334 usekeys = containers; 338 usekeys = containers;
335 last_weapon_sp = -1;
336 peaceful = 1; /* default peaceful */ 339 peaceful = 1; /* default peaceful */
337 do_los = 1; 340 do_los = 1;
338
339 /* we need to clear these to -1 and not zero - otherwise,
340 * if a player quits and starts a new character, we wont
341 * send new values to the client, as things like exp start
342 * at zero.
343 */
344 for (int i = 0; i < NUM_SKILLS; i++)
345 last_skill_exp[i] = -1;
346
347 for (int i = 0; i < NROFATTACKS; i++)
348 last_resist[i] = -1;
349
350 last_stats.exp = -1;
351 last_weight = (uint32) - 1;
352} 341}
353 342
354void 343void
355player::do_destroy () 344player::do_destroy ()
356{ 345{
903 * to save here. 892 * to save here.
904 */ 893 */
905 sprintf (buf, "%s/%s/%s", settings.localdir, settings.playerdir, &op->name); 894 sprintf (buf, "%s/%s/%s", settings.localdir, settings.playerdir, &op->name);
906 make_path_to_file (buf); 895 make_path_to_file (buf);
907 896
908#ifdef AUTOSAVE
909 op->contr->last_save_tick = pticks;
910#endif
911 start_info (op); 897 start_info (op);
912 CLEAR_FLAG (op, FLAG_WIZ); 898 CLEAR_FLAG (op, FLAG_WIZ);
913 give_initial_items (op, op->randomitems); 899 give_initial_items (op, op->randomitems);
914 link_player_skills (op); 900 link_player_skills (op);
915 esrv_send_inventory (op, op); 901 esrv_send_inventory (op, op);
3536 * not readied. 3522 * not readied.
3537 */ 3523 */
3538void 3524void
3539player_unready_range_ob (player *pl, object *ob) 3525player_unready_range_ob (player *pl, object *ob)
3540{ 3526{
3541 rangetype i;
3542
3543 for (i = (rangetype) 0; i < range_size; i = (rangetype) ((int) i + 1)) 3527 for (rangetype i = (rangetype) 0; i < range_size; i = (rangetype) ((int) i + 1))
3544 {
3545 if (pl->ranges[i] == ob) 3528 if (pl->ranges[i] == ob)
3546 { 3529 {
3547 pl->ranges[i] = NULL; 3530 pl->ranges[i] = 0;
3548 if (pl->shoottype == i) 3531 if (pl->shoottype == i)
3549 {
3550 pl->shoottype = range_none; 3532 pl->shoottype = range_none;
3551 }
3552 } 3533 }
3553 }
3554} 3534}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines