// Emacs style mode select	 -*- C++ -*- 
//-----------------------------------------------------------------------------
//
// $Id:$
//
// Copyright (C) 1993-1996 by id Software, Inc.
//
// This source is available for distribution and/or modification
// only under the terms of the DOOM Source Code License as
// published by id Software. All rights reserved.
//
// The source is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
// for more details.
//
// $Log:$
//
// DESCRIPTION:
//		Ticker.
//
//-----------------------------------------------------------------------------


#include "z_zone.h"
#include "p_local.h"
#include "p_effect.h"
#include "p_acs.h"
#include "c_console.h"

#include "doomstat.h"

extern constate_e ConsoleState;
extern gamestate_t wipegamestate;

//
// P_Ticker
//

void P_Ticker (void)
{
    // [csDoom] if the floor or the ceiling of a sector is moving,
    // mark it as moveable
    for (int i=0; i<numsectors; i++)
    {
        sector_t* sec = &sectors[i];

        if (sec->ceilingdata && sec->ceilingdata->IsKindOf (RUNTIME_CLASS(DMover)))
            sec->moveable = true;

        if (sec->floordata && sec->floordata->IsKindOf (RUNTIME_CLASS(DMover)))
            sec->moveable = true;
    }

    DThinker::RunThinkers ();

    P_UpdateSpecials ();
    P_RespawnSpecials ();

    // for par times
    level.time++;
}
