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.146 by root, Sun Jun 3 17:05:36 2007 UTC vs.
Revision 1.148 by root, Mon Jun 4 12:19:09 2007 UTC

207 ob->close_container (); //TODO: client-specific 207 ob->close_container (); //TODO: client-specific
208 208
209 ns->update_look = 0; 209 ns->update_look = 0;
210 ns->look_position = 0; 210 ns->look_position = 0;
211 211
212 clear_los (ob); 212 clear_los (this);
213 213
214 ns->reset_stats (); 214 ns->reset_stats ();
215 215
216 /* make sure he's a player -- needed because of class change. */ 216 /* make sure he's a player -- needed because of class change. */
217 ob->type = PLAYER; // we are paranoid 217 ob->type = PLAYER; // we are paranoid
232 shstr_cmp dragon_ability_force ("dragon_ability_force"); 232 shstr_cmp dragon_ability_force ("dragon_ability_force");
233 shstr_cmp dragon_skin_force ("dragon_skin_force"); 233 shstr_cmp dragon_skin_force ("dragon_skin_force");
234 234
235 for (tmp = ob->inv; tmp; tmp = tmp->below) 235 for (tmp = ob->inv; tmp; tmp = tmp->below)
236 if (tmp->type == FORCE) 236 if (tmp->type == FORCE)
237 if (tmp->arch->name == dragon_ability_force) 237 if (tmp->arch->archname == dragon_ability_force)
238 abil = tmp; 238 abil = tmp;
239 else if (tmp->arch->name == dragon_skin_force) 239 else if (tmp->arch->archname == dragon_skin_force)
240 skin = tmp; 240 skin = tmp;
241 241
242 set_dragon_name (ob, abil, skin); 242 set_dragon_name (ob, abil, skin);
243 } 243 }
244 244
324 324
325void 325void
326player::set_observe (object *op) 326player::set_observe (object *op)
327{ 327{
328 observe = op ? op : ob; 328 observe = op ? op : ob;
329 do_los = 1;
329} 330}
330 331
331player::player () 332player::player ()
332{ 333{
333 /* There are some elements we want initialised to non zero value - 334 /* There are some elements we want initialised to non zero value -
913 if (*first_map_ext_path) 914 if (*first_map_ext_path)
914 { 915 {
915 object *tmp; 916 object *tmp;
916 char mapname[MAX_BUF]; 917 char mapname[MAX_BUF];
917 918
918 snprintf (mapname, MAX_BUF - 1, "%s/%s", &first_map_ext_path, &ob->arch->name); 919 snprintf (mapname, MAX_BUF - 1, "%s/%s", &first_map_ext_path, &ob->arch->archname);
919 tmp = object::create (); 920 tmp = object::create ();
920 EXIT_PATH (tmp) = mapname; 921 EXIT_PATH (tmp) = mapname;
921 EXIT_X (tmp) = ob->x; 922 EXIT_X (tmp) = ob->x;
922 EXIT_Y (tmp) = ob->y; 923 EXIT_Y (tmp) = ob->y;
923 ob->enter_exit (tmp); /* we don't really care if it succeeded; 924 ob->enter_exit (tmp); /* we don't really care if it succeeded;
1105 if (tmp->name != NULL) 1106 if (tmp->name != NULL)
1106 sprintf (putstring, "item name: %s item type: %d weight/value: %d", 1107 sprintf (putstring, "item name: %s item type: %d weight/value: %d",
1107 &tmp->name, tmp->type, (int) (query_cost (tmp, op, F_TRUE) * 100 / (tmp->weight * MAX (tmp->nrof, 1)))); 1108 &tmp->name, tmp->type, (int) (query_cost (tmp, op, F_TRUE) * 100 / (tmp->weight * MAX (tmp->nrof, 1))));
1108 else 1109 else
1109 sprintf (putstring, "item name: %s item type: %d weight/value: %d", 1110 sprintf (putstring, "item name: %s item type: %d weight/value: %d",
1110 &tmp->arch->name, tmp->type, (int) (query_cost (tmp, op, F_TRUE) * 100 / (tmp->weight * MAX (tmp->nrof, 1)))); 1111 &tmp->arch->archname, tmp->type, (int) (query_cost (tmp, op, F_TRUE) * 100 / (tmp->weight * MAX (tmp->nrof, 1))));
1111 1112
1112 new_draw_info (NDI_UNIQUE, 0, op, putstring); 1113 new_draw_info (NDI_UNIQUE, 0, op, putstring);
1113 } 1114 }
1114 1115
1115 /* philosophy: 1116 /* philosophy:
1308 /* careful: chairs and tables are weapons! */ 1309 /* careful: chairs and tables are weapons! */
1309 if (op->contr->mode & PU_ALLWEAPON) 1310 if (op->contr->mode & PU_ALLWEAPON)
1310 { 1311 {
1311 if (tmp->type == WEAPON && tmp->name != NULL) 1312 if (tmp->type == WEAPON && tmp->name != NULL)
1312 { 1313 {
1313 if (strstr (tmp->name, "table") == NULL && strstr (tmp->arch->name, "table") == NULL && 1314 if (strstr (tmp->name, "table") == NULL && strstr (tmp->arch->archname, "table") == NULL &&
1314 strstr (tmp->name, "chair") && strstr (tmp->arch->name, "chair") == NULL) 1315 strstr (tmp->name, "chair") && strstr (tmp->arch->archname, "chair") == NULL)
1315 { 1316 {
1316 pick_up (op, tmp); 1317 pick_up (op, tmp);
1317 continue; 1318 continue;
1318 } 1319 }
1319 } 1320 }
1320 1321
1321 if (tmp->type == WEAPON && tmp->name == NULL) 1322 if (tmp->type == WEAPON && tmp->name == NULL)
1322 { 1323 {
1323 if (strstr (tmp->arch->name, "table") == NULL && strstr (tmp->arch->name, "chair") == NULL) 1324 if (strstr (tmp->arch->archname, "table") == NULL && strstr (tmp->arch->archname, "chair") == NULL)
1324 { 1325 {
1325 pick_up (op, tmp); 1326 pick_up (op, tmp);
1326 continue; 1327 continue;
1327 } 1328 }
1328 } 1329 }
1353 if (tmp->name != NULL) 1354 if (tmp->name != NULL)
1354 { 1355 {
1355 fprintf (stderr, "%s", tmp->name); 1356 fprintf (stderr, "%s", tmp->name);
1356 } 1357 }
1357 else 1358 else
1358 fprintf (stderr, "%s", tmp->arch->name); 1359 fprintf (stderr, "%s", tmp->arch->archname);
1359 fprintf (stderr, ",%d] = ", tmp->type); 1360 fprintf (stderr, ",%d] = ", tmp->type);
1360 fprintf (stderr, "%d\n", (int) (query_cost (tmp, op, F_TRUE) * 100 / (tmp->weight * MAX (tmp->nrof, 1)))); 1361 fprintf (stderr, "%d\n", (int) (query_cost (tmp, op, F_TRUE) * 100 / (tmp->weight * MAX (tmp->nrof, 1))));
1361#endif 1362#endif
1362 continue; 1363 continue;
1363 } 1364 }
3425 /* forces in the treasurelist can alter the player's stats */ 3426 /* forces in the treasurelist can alter the player's stats */
3426 object *skin; 3427 object *skin;
3427 3428
3428 /* first get the dragon skin force */ 3429 /* first get the dragon skin force */
3429 shstr_cmp dragon_skin_force ("dragon_skin_force"); 3430 shstr_cmp dragon_skin_force ("dragon_skin_force");
3430 for (skin = who->inv; skin && !(skin->arch->name == dragon_skin_force); skin = skin->below) 3431 for (skin = who->inv; skin && !(skin->arch->archname == dragon_skin_force); skin = skin->below)
3431 ; 3432 ;
3432 3433
3433 if (!skin) 3434 if (!skin)
3434 return; 3435 return;
3435 3436

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines