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.112 by root, Tue Apr 24 00:42:02 2007 UTC vs.
Revision 1.115 by root, Fri Apr 27 02:43:04 2007 UTC

291 291
292 INVOKE_PLAYER (DISCONNECT, this); 292 INVOKE_PLAYER (DISCONNECT, this);
293 293
294 ns->reset_stats (); 294 ns->reset_stats ();
295 ns->pl = 0; 295 ns->pl = 0;
296 this->ns = 0; 296 ns = 0;
297 } 297 }
298 298
299 if (ob) 299 if (ob)
300 ob->close_container (); //TODO: client-specific 300 ob->close_container (); //TODO: client-specific
301 301
318player::player () 318player::player ()
319{ 319{
320 /* There are some elements we want initialised to non zero value - 320 /* There are some elements we want initialised to non zero value -
321 * we deal with that below this point. 321 * we deal with that below this point.
322 */ 322 */
323 outputs_sync = 6; /* Every 2 seconds */ 323 outputs_sync = 4;
324 outputs_count = 10; /* Keeps present behaviour */ 324 outputs_count = 4;
325 unapply = unapply_nochoice; 325 unapply = unapply_nochoice;
326 326
327 savebed_map = first_map_path; /* Init. respawn position */ 327 savebed_map = first_map_path; /* Init. respawn position */
328 328
329 gen_sp_armour = 10; 329 gen_sp_armour = 10;
1830 case range_misc: 1830 case range_misc:
1831 fire_misc_object (op, dir); 1831 fire_misc_object (op, dir);
1832 return; 1832 return;
1833 1833
1834 case range_golem: /* Control summoned monsters from scrolls */ 1834 case range_golem: /* Control summoned monsters from scrolls */
1835 if (QUERY_FLAG (op->contr->ranges[range_golem], FLAG_REMOVED))
1836 {
1837 op->contr->ranges[range_golem] = 0;
1838 op->contr->shoottype = range_none;
1839 }
1840 else
1841 control_golem (op->contr->ranges[range_golem], dir); 1835 control_golem (op->contr->ranges[range_golem], dir);
1842 return; 1836 return;
1843 1837
1844 case range_skill: 1838 case range_skill:
1845 if (!op->chosen_skill) 1839 if (!op->chosen_skill)
1846 { 1840 {
1847 if (op->type == PLAYER) 1841 if (op->type == PLAYER)
1848 new_draw_info (NDI_UNIQUE, 0, op, "You have no applicable skill to use."); 1842 new_draw_info (NDI_UNIQUE, 0, op, "You have no applicable skill to use.");
1843
1849 return; 1844 return;
1850 } 1845 }
1851 1846
1852 do_skill (op, op, op->chosen_skill, dir, NULL); 1847 do_skill (op, op, op->chosen_skill, dir, NULL);
1853 return; 1848 return;
2261 op->speed_left--; 2256 op->speed_left--;
2262 return 0; 2257 return 0;
2263 } 2258 }
2264 } 2259 }
2265 2260
2266 /* I've been seeing crashes where the golem has been destroyed, but
2267 * the player object still points to the defunct golem. The code that
2268 * destroys the golem looks correct, and it doesn't always happen, so
2269 * put this in a a workaround to clean up the golem pointer.
2270 */
2271 if (op->contr->ranges[range_golem] && QUERY_FLAG (op->contr->ranges[range_golem], FLAG_REMOVED))
2272 op->contr->ranges[range_golem] = 0;
2273
2274 /* call this here - we also will call this in do_ericserver, but 2261 /* call this here - we also will call this in do_ericserver, but
2275 * the players time has been increased when doericserver has been 2262 * the players time has been increased when doericserver has been
2276 * called, so we recheck it here. 2263 * called, so we recheck it here.
2277 */ 2264 */
2278 if (op->contr->ns->handle_command ()) 2265 if (op->contr->ns->handle_command ())
2432 make_visible (op); 2419 make_visible (op);
2433 new_draw_info (NDI_UNIQUE, 0, op, "Your invisibility spell runs out."); 2420 new_draw_info (NDI_UNIQUE, 0, op, "Your invisibility spell runs out.");
2434 } 2421 }
2435 } 2422 }
2436 2423
2437 if (op->contr->outputs_sync)
2438 for (i = 0; i < NUM_OUTPUT_BUFS; i++)
2439 if (op->contr->outputs[i].buf && (op->contr->outputs[i].first_update + op->contr->outputs_sync) < (uint16) pticks)
2440 flush_output_element (op, &op->contr->outputs[i]);
2441
2442 if (op->contr->ns->state == ST_PLAYING) 2424 if (op->contr->ns->state == ST_PLAYING)
2443 { 2425 {
2444 /* these next three if clauses make it possible to SLOW DOWN 2426 /* these next three if clauses make it possible to SLOW DOWN
2445 hp/grace/spellpoint regeneration. */ 2427 hp/grace/spellpoint regeneration. */
2446 if (op->contr->gen_hp >= 0) 2428 if (op->contr->gen_hp >= 0)
2466 gen_grace = op->stats.maxgrace; 2448 gen_grace = op->stats.maxgrace;
2467 rate_grace -= rate_grace / 2 * op->contr->gen_grace; 2449 rate_grace -= rate_grace / 2 * op->contr->gen_grace;
2468 } 2450 }
2469 2451
2470 /* Regenerate Spell Points */ 2452 /* Regenerate Spell Points */
2471 if (op->contr->ranges[range_golem] == NULL && --op->last_sp < 0) 2453 if (!op->contr->ranges[range_golem] && --op->last_sp < 0)
2472 { 2454 {
2473 gen_sp = gen_sp * 10 / (op->contr->gen_sp_armour < 10 ? 10 : op->contr->gen_sp_armour); 2455 gen_sp = gen_sp * 10 / (op->contr->gen_sp_armour < 10 ? 10 : op->contr->gen_sp_armour);
2474 if (op->stats.sp < op->stats.maxsp) 2456 if (op->stats.sp < op->stats.maxsp)
2475 { 2457 {
2476 op->stats.sp++; 2458 op->stats.sp++;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines