--- deliantra/server/server/main.C 2006/12/23 13:56:25 1.55 +++ deliantra/server/server/main.C 2006/12/25 11:25:49 1.56 @@ -901,18 +901,16 @@ for (flag = 1; flag != 0;) { flag = 0; - for (player *plnext, *pl = first_player; pl; pl = plnext) + for_all_players (pl) { - plnext = pl->next; /* In case a player exits the game in handle_player() */ + pl->refcnt_chk (); - if (!pl->ob) + if (!pl->ob || !pl->ns) continue; if (pl->ob->speed_left > 0) - { - if (handle_newcs_player (pl->ob)) - flag = 1; - } /* end if player has speed left */ + if (handle_newcs_player (pl->ob)) + flag = 1; /* If the player is not actively playing, don't make a * backup save - nothing to save anyway. Plus, the @@ -938,6 +936,9 @@ for_all_players (pl) { + if (!pl->ob || !pl->ns) + continue; + if (settings.casting_time) { if (pl->ob->casting_time > 0) @@ -987,10 +988,12 @@ { object *op; - static object *marker; + static object_ptr marker_; + + if (!marker_) + marker_ = object::create (); - if (!marker) - marker = object::create (); + object *marker = marker_; process_players1 (); @@ -999,7 +1002,7 @@ if (marker->active_next) marker->active_next->active_prev = marker; - marker->active_prev = NULL; + marker->active_prev = 0; active_objects = marker; while (marker->active_next) @@ -1326,7 +1329,7 @@ // then do some bookkeeping, should not really be here check_active_maps (); /* Removes unused maps after a certain timeout */ do_specials (); /* Routines called from time to time. */ - object::free_mortals (); + attachable::check_mortals (); ++pticks; }