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.40 by root, Thu Dec 14 22:45:41 2006 UTC vs.
Revision 1.41 by root, Fri Dec 15 04:21:29 2006 UTC

2564 if (op->speed_left > 0) 2564 if (op->speed_left > 0)
2565 return 1; 2565 return 1;
2566 else 2566 else
2567 return 0; 2567 return 0;
2568 } 2568 }
2569
2569 return 0; 2570 return 0;
2570} 2571}
2571 2572
2572int 2573int
2573save_life (object *op) 2574save_life (object *op)
2574{ 2575{
2575 object *tmp;
2576
2577 if (!QUERY_FLAG (op, FLAG_LIFESAVE)) 2576 if (!QUERY_FLAG (op, FLAG_LIFESAVE))
2578 return 0; 2577 return 0;
2579 2578
2580 for (tmp = op->inv; tmp != NULL; tmp = tmp->below) 2579 for (object *tmp = op->inv; tmp; tmp = tmp->below)
2581 if (QUERY_FLAG (tmp, FLAG_APPLIED) && QUERY_FLAG (tmp, FLAG_LIFESAVE)) 2580 if (QUERY_FLAG (tmp, FLAG_APPLIED) && QUERY_FLAG (tmp, FLAG_LIFESAVE))
2582 { 2581 {
2583 play_sound_map (op->map, op->x, op->y, SOUND_OB_EVAPORATE); 2582 play_sound_map (op->map, op->x, op->y, SOUND_OB_EVAPORATE);
2584 new_draw_info_format (NDI_UNIQUE, 0, op, "Your %s vibrates violently, then evaporates.", query_name (tmp)); 2583 new_draw_info_format (NDI_UNIQUE, 0, op, "Your %s vibrates violently, then evaporates.", query_name (tmp));
2585 2584
2596 op->stats.food = 999; 2595 op->stats.food = 999;
2597 2596
2598 fix_player (op); 2597 fix_player (op);
2599 return 1; 2598 return 1;
2600 } 2599 }
2600
2601 LOG (llevError, "Error: LIFESAVE set without applied object.\n"); 2601 LOG (llevError, "Error: LIFESAVE set without applied object.\n");
2602 CLEAR_FLAG (op, FLAG_LIFESAVE); 2602 CLEAR_FLAG (op, FLAG_LIFESAVE);
2603 enter_player_savebed (op); /* bring him home. */ 2603 enter_player_savebed (op); /* bring him home. */
2604 return 0; 2604 return 0;
2605} 2605}
2628 esrv_del_item (env->contr, op->count); 2628 esrv_del_item (env->contr, op->count);
2629 insert_ob_in_map (op, env->map, NULL, 0); 2629 insert_ob_in_map (op, env->map, NULL, 0);
2630 } 2630 }
2631 else if (op->inv) 2631 else if (op->inv)
2632 remove_unpaid_objects (op->inv, env); 2632 remove_unpaid_objects (op->inv, env);
2633
2633 op = next; 2634 op = next;
2634 } 2635 }
2635} 2636}
2636 2637
2637 2638
2652 strcpy (buf2, " R.I.P.\n\n"); 2653 strcpy (buf2, " R.I.P.\n\n");
2653 if (op->type == PLAYER) 2654 if (op->type == PLAYER)
2654 sprintf (buf, "%s the %s\n", &op->name, op->contr->title); 2655 sprintf (buf, "%s the %s\n", &op->name, op->contr->title);
2655 else 2656 else
2656 sprintf (buf, "%s\n", &op->name); 2657 sprintf (buf, "%s\n", &op->name);
2658
2657 strncat (buf2, " ", 20 - strlen (buf) / 2); 2659 strncat (buf2, " ", 20 - strlen (buf) / 2);
2658 strcat (buf2, buf); 2660 strcat (buf2, buf);
2659 if (op->type == PLAYER) 2661 if (op->type == PLAYER)
2660 sprintf (buf, "who was in level %d when killed\n", op->level); 2662 sprintf (buf, "who was in level %d when killed\n", op->level);
2661 else 2663 else
2662 sprintf (buf, "who was in level %d when died.\n\n", op->level); 2664 sprintf (buf, "who was in level %d when died.\n\n", op->level);
2665
2663 strncat (buf2, " ", 20 - strlen (buf) / 2); 2666 strncat (buf2, " ", 20 - strlen (buf) / 2);
2664 strcat (buf2, buf); 2667 strcat (buf2, buf);
2665 if (op->type == PLAYER) 2668 if (op->type == PLAYER)
2666 { 2669 {
2667 sprintf (buf, "by %s.\n\n", op->contr->killer); 2670 sprintf (buf, "by %s.\n\n", op->contr->killer);
2668 strncat (buf2, " ", 21 - strlen (buf) / 2); 2671 strncat (buf2, " ", 21 - strlen (buf) / 2);
2669 strcat (buf2, buf); 2672 strcat (buf2, buf);
2670 } 2673 }
2674
2671 strftime (buf, MAX_BUF, "%b %d %Y\n", localtime (&now)); 2675 strftime (buf, MAX_BUF, "%b %d %Y\n", localtime (&now));
2672 strncat (buf2, " ", 20 - strlen (buf) / 2); 2676 strncat (buf2, " ", 20 - strlen (buf) / 2);
2673 strcat (buf2, buf); 2677 strcat (buf2, buf);
2678
2674 return buf2; 2679 return buf2;
2675} 2680}
2676 2681
2677 2682
2678 2683

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines