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.15 by pippijn, Tue May 2 15:41:03 2006 UTC vs.
Revision 1.21 by elmex, Fri Aug 11 23:04:50 2006 UTC

1/* 1/*
2 * static char *rcsid_player_c = 2 * static char *rcsid_player_c =
3 * "$Id: player.c,v 1.15 2006/05/02 15:41:03 pippijn Exp $"; 3 * "$Id: player.c,v 1.21 2006/08/11 23:04:50 elmex Exp $";
4 */ 4 */
5 5
6/* 6/*
7 CrossFire, A Multiplayer game for X-windows 7 CrossFire, A Multiplayer game for X-windows
8 8
149 continue; 149 continue;
150 if ( *buf =='%'){ /* send one news */ 150 if ( *buf =='%'){ /* send one news */
151 if (size>0) 151 if (size>0)
152 draw_ext_info_format(NDI_UNIQUE | NDI_GREEN, 0, op, 152 draw_ext_info_format(NDI_UNIQUE | NDI_GREEN, 0, op,
153 MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_NEWS, 153 MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_NEWS,
154 "!! informations: %s\n%s", 154 "INFORMATION: %s\n%s",
155 "%s\n%s", 155 "%s\n%s",
156 subject, news); /*send previously read news*/ 156 subject, news); /*send previously read news*/
157 strcpy(subject,buf+1); 157 strcpy(subject,buf+1);
158 strip_endline(subject); 158 strip_endline(subject);
159 size=0; 159 size=0;
170 } 170 }
171 } 171 }
172 172
173 draw_ext_info_format(NDI_UNIQUE | NDI_GREEN, 0, op, 173 draw_ext_info_format(NDI_UNIQUE | NDI_GREEN, 0, op,
174 MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_NEWS, 174 MSG_TYPE_ADMIN, MSG_TYPE_ADMIN_NEWS,
175 "!! informations: %s\n%s\n", 175 "INFORMATION: %s\n%s\n",
176 "%s\n%s", 176 "%s\n%s",
177 subject, news); 177 subject, news);
178 close_and_delete(fp, comp); 178 close_and_delete(fp, comp);
179} 179}
180 180
265 p->last_speed= -1; 265 p->last_speed= -1;
266 p->shoottype=range_none; 266 p->shoottype=range_none;
267 p->bowtype=bow_normal; 267 p->bowtype=bow_normal;
268 p->petmode=pet_normal; 268 p->petmode=pet_normal;
269 p->listening=10; 269 p->listening=10;
270 p->usekeys=containers;
270 p->last_weapon_sp= -1; 271 p->last_weapon_sp= -1;
271 p->peaceful=1; /* default peaceful */ 272 p->peaceful=1; /* default peaceful */
272 p->do_los=1; 273 p->do_los=1;
273 p->explore=0; 274 p->explore=0;
274 p->no_shout=0; /* default can shout */ 275 p->no_shout=0; /* default can shout */
488 489
489 mflags = get_map_flags(m, &m, x, y, &x, &y); 490 mflags = get_map_flags(m, &m, x, y, &x, &y);
490 blocked = (mflags & P_OUT_OF_MAP) ? MOVE_ALL : GET_MAP_MOVE_BLOCK(m, x, y); 491 blocked = (mflags & P_OUT_OF_MAP) ? MOVE_ALL : GET_MAP_MOVE_BLOCK(m, x, y);
491 492
492 /* Space is blocked - try changing direction a little */ 493 /* Space is blocked - try changing direction a little */
493 if ((mflags & P_OUT_OF_MAP) || ((OB_TYPE_MOVE_BLOCK(mon, blocked)) 494 if ((mflags & P_OUT_OF_MAP) || ((OB_TYPE_MOVE_BLOCK(mon, blocked) || (mflags&P_BLOCKSVIEW))
494 && (m == mon->map && blocked_link(mon, m, x, y)))) { 495 && (m == mon->map && blocked_link(mon, m, x, y)))) {
495 /* recalculate direction from last good location. Possible 496 /* recalculate direction from last good location. Possible
496 * we were not traversing ideal location before. 497 * we were not traversing ideal location before.
497 */ 498 */
498 get_rangevector_from_mapcoord(lastmap, lastx, lasty, pl, &rv, 0); 499 get_rangevector_from_mapcoord(lastmap, lastx, lasty, pl, &rv, 0);
532 m = lastmap; 533 m = lastmap;
533 mflags = get_map_flags(m, &m, x, y, &x, &y); 534 mflags = get_map_flags(m, &m, x, y, &x, &y);
534 if (mflags & P_OUT_OF_MAP) continue; 535 if (mflags & P_OUT_OF_MAP) continue;
535 blocked = GET_MAP_MOVE_BLOCK(m, x, y); 536 blocked = GET_MAP_MOVE_BLOCK(m, x, y);
536 if (OB_TYPE_MOVE_BLOCK(mon, blocked)) continue; 537 if (OB_TYPE_MOVE_BLOCK(mon, blocked)) continue;
538 if (mflags & P_BLOCKSVIEW) continue;
537 539
538 if (m == mon->map && blocked_link(mon, m, x, y)) break; 540 if (m == mon->map && blocked_link(mon, m, x, y)) break;
539 } 541 }
540 /* go through entire loop without finding a valid 542 /* go through entire loop without finding a valid
541 * sidestep to take - thus, no valid path. 543 * sidestep to take - thus, no valid path.
1009 object *tmp; 1011 object *tmp;
1010 mapstruct *oldmap = op->map; 1012 mapstruct *oldmap = op->map;
1011 char mapname[MAX_BUF]; 1013 char mapname[MAX_BUF];
1012 snprintf(mapname, MAX_BUF-1, "%s/%s", 1014 snprintf(mapname, MAX_BUF-1, "%s/%s",
1013 first_map_ext_path, op->arch->name); 1015 first_map_ext_path, op->arch->name);
1014 printf("%s\n", mapname);
1015 tmp=get_object(); 1016 tmp=get_object();
1016 EXIT_PATH(tmp) = add_string(mapname); 1017 EXIT_PATH(tmp) = add_string(mapname);
1017 EXIT_X(tmp) = op->x; 1018 EXIT_X(tmp) = op->x;
1018 EXIT_Y(tmp) = op->y; 1019 EXIT_Y(tmp) = op->y;
1019 enter_exit(op,tmp); /* we don't really care if it succeeded; 1020 enter_exit(op,tmp); /* we don't really care if it succeeded;
1049 insert_ob_in_map (op, op->map, op,0); 1050 insert_ob_in_map (op, op->map, op,0);
1050 strncpy(op->contr->title, op->arch->clone.name, sizeof(op->contr->title)-1); 1051 strncpy(op->contr->title, op->arch->clone.name, sizeof(op->contr->title)-1);
1051 op->contr->title[sizeof(op->contr->title)-1] = '\0'; 1052 op->contr->title[sizeof(op->contr->title)-1] = '\0';
1052 add_statbonus(op); 1053 add_statbonus(op);
1053 tmp_loop=allowed_class(op); 1054 tmp_loop=allowed_class(op);
1055
1056 if (!strncmp (op->msg, "Edit me", 7)) tmp_loop = 0; // pippijn fucked it up //D//TODO
1054 } 1057 }
1055 update_object(op,UP_OBJ_FACE); 1058 update_object(op,UP_OBJ_FACE);
1056 esrv_update_item(UPD_FACE,op,op); 1059 esrv_update_item(UPD_FACE,op,op);
1057 fix_player(op); 1060 fix_player(op);
1058 op->stats.hp=op->stats.maxhp; 1061 op->stats.hp=op->stats.maxhp;
2672 2675
2673 /* Lauwenmark: Handle for plugin death event */ 2676 /* Lauwenmark: Handle for plugin death event */
2674 if (execute_event(op, EVENT_DEATH,NULL,NULL,NULL,SCRIPT_FIX_ALL) != 0) 2677 if (execute_event(op, EVENT_DEATH,NULL,NULL,NULL,SCRIPT_FIX_ALL) != 0)
2675 return; 2678 return;
2676 2679
2680 command_kill_pets (op, 0);
2681
2677 /* Lauwenmark: Handle for the global death event */ 2682 /* Lauwenmark: Handle for the global death event */
2678 execute_global_event(EVENT_PLAYER_DEATH, op); 2683 execute_global_event(EVENT_PLAYER_DEATH, op);
2679 if(op->stats.food<0) { 2684 if(op->stats.food<0) {
2680 if (op->contr->explore) { 2685 if (op->contr->explore) {
2681 new_draw_info(NDI_UNIQUE, 0,op,"You would have starved, but you are"); 2686 new_draw_info(NDI_UNIQUE, 0,op,"You would have starved, but you are");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines