touch, think and blocked now support methods

also a little whitespace cleanup
This commit is contained in:
Bill Currie 2002-05-31 21:05:58 +00:00
parent 9e5f8c3bd9
commit e8026d9c76
10 changed files with 126 additions and 61 deletions

View file

@ -184,4 +184,54 @@ extern func_t SpectatorThink;
extern func_t SpectatorDisconnect;
extern func_t UserInfoCallback;
static inline void
sv_pr_touch (edict_t *self, edict_t *other)
{
int this;
*sv_globals.self = EDICT_TO_PROG (&sv_pr_state, self);
*sv_globals.other = EDICT_TO_PROG (&sv_pr_state, other);
if ((this = sv_pr_state.fields.this) != -1) {
P_INT (&sv_pr_state, 0) = E_var (self, this, integer);
P_INT (&sv_pr_state, 1) = 0;
P_INT (&sv_pr_state, 2) = E_var (other, this, integer);
}
PR_ExecuteProgram (&sv_pr_state, SVfunc (self, touch));
}
static inline void
sv_pr_use (edict_t *self, edict_t *other)
{
}
static inline void
sv_pr_think (edict_t *self)
{
int this;
*sv_globals.self = EDICT_TO_PROG (&sv_pr_state, self);
*sv_globals.other = 0;
if ((this = sv_pr_state.fields.this) != -1) {
P_INT (&sv_pr_state, 0) = E_var (self, this, integer);
P_INT (&sv_pr_state, 1) = 0;
P_INT (&sv_pr_state, 2) = 0;
}
PR_ExecuteProgram (&sv_pr_state, SVfunc (self, think));
}
static inline void
sv_pr_blocked (edict_t *self, edict_t *other)
{
int this;
*sv_globals.self = EDICT_TO_PROG (&sv_pr_state, self);
*sv_globals.other = EDICT_TO_PROG (&sv_pr_state, other);
if ((this = sv_pr_state.fields.this) != -1) {
P_INT (&sv_pr_state, 0) = E_var (self, this, integer);
P_INT (&sv_pr_state, 1) = 0;
P_INT (&sv_pr_state, 2) = E_var (other, this, integer);
}
PR_ExecuteProgram (&sv_pr_state, SVfunc (self, blocked));
}
#endif // __sv_progs_h