mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-30 00:10:40 +00:00
touch, think and blocked now support methods
also a little whitespace cleanup
This commit is contained in:
parent
9e5f8c3bd9
commit
e8026d9c76
10 changed files with 126 additions and 61 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue