2003-10-24 21:43:32 +00:00
|
|
|
#include "common.qh"
|
2003-10-27 22:27:29 +00:00
|
|
|
#include "misc.qh"
|
2003-10-24 21:43:32 +00:00
|
|
|
#include "act.qh"
|
|
|
|
#include "server.qh"
|
2003-10-27 22:27:29 +00:00
|
|
|
#include "menu.qh"
|
|
|
|
#include "mdl.qh"
|
|
|
|
#include "weapon.qh"
|
2003-10-24 21:43:32 +00:00
|
|
|
|
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 ();
|
2003-10-24 21:43:32 +00:00
|
|
|
|
|
|
|
if (self.prethink)
|
2004-02-09 04:25:00 +00:00
|
|
|
self.prethink ();
|
2003-10-24 21:43:32 +00:00
|
|
|
};
|
|
|
|
|
2004-02-09 04:25:00 +00:00
|
|
|
void ()
|
|
|
|
act_think =
|
|
|
|
{
|
|
|
|
if (!is_autothink (self)) {
|
2003-10-24 21:43:32 +00:00
|
|
|
frametime = 0.1;
|
2004-02-09 04:25:00 +00:00
|
|
|
PlayerPreThink ();
|
2003-10-24 21:43:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*if (0.1 seconds have passed) {*/
|
|
|
|
if (self.actthink)
|
2004-02-09 04:25:00 +00:00
|
|
|
self.actthink ();
|
2003-10-24 21:43:32 +00:00
|
|
|
|
|
|
|
if (self.menu_think)
|
2004-02-09 04:25:00 +00:00
|
|
|
self.menu_think ();
|
2003-10-24 21:43:32 +00:00
|
|
|
|
|
|
|
if (self.mdl_think && !self.mdl_thought)
|
2004-02-09 04:25:00 +00:00
|
|
|
self.mdl_think ();
|
2003-10-24 21:43:32 +00:00
|
|
|
self.mdl_thought = FALSE;
|
|
|
|
|
|
|
|
if (self.w_think && !self.w_thought)
|
2004-02-09 04:25:00 +00:00
|
|
|
self.w_think ();
|
2003-10-24 21:43:32 +00:00
|
|
|
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 ();
|
2003-10-24 21:43:32 +00:00
|
|
|
};
|
|
|
|
|
2004-02-09 04:25:00 +00:00
|
|
|
void ()
|
|
|
|
PlayerPostThink =
|
|
|
|
{
|
2003-10-24 21:43:32 +00:00
|
|
|
if (self.postthink)
|
2004-02-09 04:25:00 +00:00
|
|
|
self.postthink ();
|
2003-10-24 21:43:32 +00:00
|
|
|
|
2004-02-09 04:25:00 +00:00
|
|
|
if (is_cl (self))
|
|
|
|
PlayerEndFrame ();
|
2003-10-24 21:43:32 +00:00
|
|
|
};
|
|
|
|
|
2004-02-09 04:25:00 +00:00
|
|
|
void ()
|
|
|
|
act_setup =
|
|
|
|
{
|
2003-10-24 21:43:32 +00:00
|
|
|
self.think = act_think;
|
|
|
|
self.nextthink = time;
|
|
|
|
};
|