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.103 by root, Sat Feb 10 01:52:29 2007 UTC vs.
Revision 1.104 by root, Fri Feb 16 19:43:41 2007 UTC

116 116
117 news[0] = '\0'; 117 news[0] = '\0';
118 subject[0] = '\0'; 118 subject[0] = '\0';
119 size = 0; 119 size = 0;
120 120
121 while (fgets (buf, MAX_BUF, fp) != NULL) 121 while (fgets (buf, MAX_BUF, fp))
122 { 122 {
123 if (*buf == '#') 123 if (*buf == '#')
124 continue; 124 continue;
125 125
126 if (*buf == '%') 126 if (*buf == '%')
197 remove_friendly_object (ob); 197 remove_friendly_object (ob);
198 ob->deactivate_recursive (); 198 ob->deactivate_recursive ();
199 maplevel = ob->map->path; 199 maplevel = ob->map->path;
200 ob->remove (); 200 ob->remove ();
201 ob->map = 0; 201 ob->map = 0;
202 party = 0;
202 203
203 // for weird reasons, this is often "ob", keeping a circular reference 204 // for weird reasons, this is often "ob", keeping a circular reference
204 ranges [range_skill] = 0; 205 ranges [range_skill] = 0;
205 206
206 players.erase (this); 207 players.erase (this);
236 link_player_skills (ob); 237 link_player_skills (ob);
237 238
238 CLEAR_FLAG (ob, FLAG_NO_FIX_PLAYER); 239 CLEAR_FLAG (ob, FLAG_NO_FIX_PLAYER);
239 240
240 assign (title, ob->arch->clone.name); 241 assign (title, ob->arch->clone.name);
241
242 /* can_use_shield is a new flag. However, the can_use.. seems to largely come
243 * from the class, and not race. I don't see any way to get the class information
244 * to then update this. I don't think this will actually break anything - anyone
245 * that can use armour should be able to use a shield. What this may 'break'
246 * are features new characters get, eg, if someone starts up with a Q, they
247 * should be able to use a shield. However, old Q's won't get that advantage.
248 */
249 if (QUERY_FLAG (ob, FLAG_USE_ARMOUR))
250 SET_FLAG (ob, FLAG_USE_SHIELD);
251 242
252 /* if it's a dragon player, set the correct title here */ 243 /* if it's a dragon player, set the correct title here */
253 if (is_dragon_pl (ob)) 244 if (is_dragon_pl (ob))
254 { 245 {
255 object *tmp, *abil = 0, *skin = 0; 246 object *tmp, *abil = 0, *skin = 0;
310// by load_object not returning the object 301// by load_object not returning the object
311void 302void
312player::set_object (object *op) 303player::set_object (object *op)
313{ 304{
314 ob = op; 305 ob = op;
315 ob->contr = this; /* this aren't yet in archetype */ 306 ob->contr = this; /* this aren't yet in archetype */
316 307
317 ob->speed_left = 0.5; 308 ob->speed_left = 0.5;
318 ob->speed = 1.0; 309 ob->speed = 1.0;
319 ob->direction = 5; /* So player faces south */ 310 ob->direction = 5; /* So player faces south */
320 ob->stats.wc = 2;
321 ob->run_away = 25; /* Then we panick... */
322
323 ob->roll_stats ();
324} 311}
325 312
326player::player () 313player::player ()
327{ 314{
328 /* There are some elements we want initialised to non zero value - 315 /* There are some elements we want initialised to non zero value -
372player::create () 359player::create ()
373{ 360{
374 player *pl = new player; 361 player *pl = new player;
375 362
376 pl->set_object (arch_to_object (get_player_archetype (0))); 363 pl->set_object (arch_to_object (get_player_archetype (0)));
364
365 pl->ob->roll_stats ();
366 pl->ob->stats.wc = 2;
367 pl->ob->run_away = 25; /* Then we panick... */
368
377 set_first_map (pl->ob); 369 set_first_map (pl->ob);
378 370
379 return pl; 371 return pl;
380} 372}
381 373

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines