PMove: Add flag FL_ONUSABLE, which will tell us if we're looking/hovering
over something that we can +use on.
This commit is contained in:
parent
5439bfb59b
commit
565d8ad7e7
2 changed files with 18 additions and 1 deletions
|
@ -38,6 +38,6 @@
|
|||
#define FL_FROZEN (1<<19)
|
||||
#define FL_USE_RELEASED (1<<20)
|
||||
#define FL_NOATTACK (1<<21)
|
||||
#define FL_RESERVED1 (1<<22)
|
||||
#define FL_ONUSABLE (1<<22)
|
||||
#define FL_RESERVED2 (1<<23)
|
||||
#define FL_RESERVED3 (1<<15)
|
||||
|
|
|
@ -323,6 +323,23 @@ base_player::Physics_Run(void)
|
|||
input_buttons = saved_input_buttons;
|
||||
Physics_InputPostMove();
|
||||
|
||||
#ifdef SERVER
|
||||
/* Use Flagger */
|
||||
vector src, dest;
|
||||
makevectors(input_angles);
|
||||
src = origin + view_ofs;
|
||||
dest = src + v_forward * 64;
|
||||
traceline(src, dest, MOVE_NORMAL, this);
|
||||
|
||||
flags &= ~FL_ONUSABLE;
|
||||
if (trace_ent.identity == 1) {
|
||||
CBaseEntity foo = (CBaseEntity)trace_ent;
|
||||
if (foo.PlayerUse) {
|
||||
flags |= FL_ONUSABLE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
angles[0] = Math_FixDelta(angles[0]);
|
||||
angles[1] = Math_FixDelta(angles[1]);
|
||||
angles[2] = Math_FixDelta(angles[2]);
|
||||
|
|
Loading…
Reference in a new issue