game-source/klik/act/act.qc

69 lines
1 KiB
C++
Raw Normal View History

#include "common.qh"
2003-10-27 22:27:29 +00:00
#include "misc.qh"
#include "act.qh"
#include "server.qh"
2003-10-27 22:27:29 +00:00
#include "menu.qh"
#include "mdl.qh"
#include "weapon.qh"
2004-02-09 04:25:00 +00:00
.void () prethink;
.void () actthink;
.void () postthink;
2003-10-28 21:20:34 +00:00
2004-02-09 04:25:00 +00:00
void ()
PlayerPreThink =
{
if (is_cl (self))
PlayerStartFrame ();
if (self.prethink)
2004-02-09 04:25:00 +00:00
self.prethink ();
};
2004-02-09 04:25:00 +00:00
void ()
act_think =
{
if (!is_autothink (self)) {
frametime = 0.1;
2004-02-09 04:25:00 +00:00
PlayerPreThink ();
}
/*if (0.1 seconds have passed) {*/
if (self.actthink)
2004-02-09 04:25:00 +00:00
self.actthink ();
if (self.menu_think)
2004-02-09 04:25:00 +00:00
self.menu_think ();
if (self.mdl_think && !self.mdl_thought)
2004-02-09 04:25:00 +00:00
self.mdl_think ();
self.mdl_thought = FALSE;
if (self.w_think && !self.w_thought)
2004-02-09 04:25:00 +00:00
self.w_think ();
self.w_thought = FALSE;
/*}*/
self.nextthink = time + 0.1; /* FIXME: Use sv_mintic here when non-client? */
2004-02-09 04:25:00 +00:00
if (!is_autothink (self))
PlayerPostThink ();
};
2004-02-09 04:25:00 +00:00
void ()
PlayerPostThink =
{
if (self.postthink)
2004-02-09 04:25:00 +00:00
self.postthink ();
2004-02-09 04:25:00 +00:00
if (is_cl (self))
PlayerEndFrame ();
};
2004-02-09 04:25:00 +00:00
void ()
act_setup =
{
self.think = act_think;
self.nextthink = time;
};