NSEntity: .touch being assigned is being deprecated in favor of our internal Touch(entity).
This is so we can support StartTouch(entity) as well as EndTouch(entity) which are implemented with this commit. Update your entities touch() function overrides for NSEntity sub-classes!
This commit is contained in:
parent
60e4853549
commit
75a1c8ce6c
10 changed files with 268 additions and 106 deletions
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
|
||||
/* PICKUP ITEMS */
|
||||
class item_pickup:CBaseTrigger
|
||||
class item_pickup:NSRenderableEntity
|
||||
{
|
||||
int m_bFloating;
|
||||
int m_iClip;
|
||||
|
@ -23,7 +23,7 @@ class item_pickup:CBaseTrigger
|
|||
int id;
|
||||
void(void) item_pickup;
|
||||
|
||||
virtual void(void) touch;
|
||||
virtual void(entity) Touch;
|
||||
virtual void(int i) SetItem;
|
||||
virtual void(void) Respawn;
|
||||
virtual void(int) SetFloating;
|
||||
|
|
|
@ -15,20 +15,20 @@
|
|||
*/
|
||||
|
||||
void
|
||||
item_pickup::touch(void)
|
||||
item_pickup::Touch(entity eToucher)
|
||||
{
|
||||
if (other.classname != "player") {
|
||||
if (eToucher.classname != "player") {
|
||||
return;
|
||||
}
|
||||
|
||||
/* don't remove if AddItem fails */
|
||||
if (Weapons_AddItem((base_player)other, id, m_iClip) == FALSE) {
|
||||
if (Weapons_AddItem((base_player)eToucher, id, m_iClip) == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
Logging_Pickup(other, this, __NULL__);
|
||||
Logging_Pickup(eToucher, this, __NULL__);
|
||||
|
||||
UseTargets(other, TRIG_TOGGLE, m_flDelay);
|
||||
UseTargets(eToucher, TRIG_TOGGLE, m_flDelay);
|
||||
|
||||
if (real_owner || m_iWasDropped == 1 || cvar("sv_playerslots") == 1) {
|
||||
remove(self);
|
||||
|
@ -44,8 +44,7 @@ item_pickup::SetItem(int i)
|
|||
{
|
||||
id = i;
|
||||
m_oldModel = Weapons_GetWorldmodel(id);
|
||||
SetModel(m_oldModel);
|
||||
SetSize([-16,-16,0], [16,16,16]);
|
||||
Respawn();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -58,7 +57,7 @@ void
|
|||
item_pickup::Respawn(void)
|
||||
{
|
||||
SetSolid(SOLID_TRIGGER);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
|
||||
/* At some points, the item id might not yet be set */
|
||||
if (m_oldModel) {
|
||||
|
@ -83,6 +82,6 @@ item_pickup::Respawn(void)
|
|||
void
|
||||
item_pickup::item_pickup(void)
|
||||
{
|
||||
CBaseTrigger::CBaseTrigger();
|
||||
super::NSRenderableEntity();
|
||||
Respawn();
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ class func_button:NSSurfacePropEntity
|
|||
virtual void(void) Returned;
|
||||
virtual void(void) MoveBack;
|
||||
virtual void(void) MoveAway;
|
||||
virtual void(void) Touch;
|
||||
virtual void(entity) Touch;
|
||||
virtual void(entity) Blocked;
|
||||
virtual void(entity, int) Trigger;
|
||||
virtual void(void) DeathTrigger;
|
||||
|
@ -324,14 +324,14 @@ func_button::DeathTrigger(void)
|
|||
}
|
||||
|
||||
void
|
||||
func_button::Touch(void)
|
||||
func_button::Touch(entity eToucher)
|
||||
{
|
||||
if (other.movetype == MOVETYPE_WALK) {
|
||||
Trigger(other, TRIG_TOGGLE);
|
||||
|
||||
if (!HasSpawnFlags(SF_BTT_TOUCH_ONLY)) {
|
||||
touch = __NULL__;
|
||||
}
|
||||
if (!HasSpawnFlags(SF_BTT_TOUCH_ONLY)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (eToucher.movetype == MOVETYPE_WALK) {
|
||||
Trigger(eToucher, TRIG_TOGGLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -425,10 +425,8 @@ func_button::Respawn(void)
|
|||
}
|
||||
|
||||
if (HasSpawnFlags(SF_BTT_TOUCH_ONLY)) {
|
||||
touch = Touch;
|
||||
PlayerUse = __NULL__;
|
||||
} else {
|
||||
touch = __NULL__;
|
||||
PlayerUse = Use;
|
||||
}
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ class func_door:NSRenderableEntity
|
|||
virtual void(void) Respawn;
|
||||
virtual void(entity, int) Trigger;
|
||||
virtual void(entity) Blocked;
|
||||
virtual void(void) Touch;
|
||||
virtual void(entity) Touch;
|
||||
virtual void(void) Use;
|
||||
virtual void(float) Save;
|
||||
virtual void(string, string) Restore;
|
||||
|
@ -291,8 +291,11 @@ func_door::Trigger(entity act, int state)
|
|||
}
|
||||
|
||||
void
|
||||
func_door::Touch(void)
|
||||
func_door::Touch(entity eToucher)
|
||||
{
|
||||
if (HasSpawnFlags(SF_MOV_USE))
|
||||
return;
|
||||
|
||||
if (m_iLocked || !GetMaster()) {
|
||||
if (m_flSoundWait < time)
|
||||
Sound_Play(this, CHAN_VOICE, m_strLockedSfx);
|
||||
|
@ -305,9 +308,9 @@ func_door::Touch(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (other.movetype == MOVETYPE_WALK) {
|
||||
if (other.absmin[2] <= maxs[2] - 2) {
|
||||
Trigger(other, TRIG_TOGGLE);
|
||||
if (eToucher.movetype == MOVETYPE_WALK) {
|
||||
if (eToucher.absmin[2] <= maxs[2] - 2) {
|
||||
Trigger(eToucher, TRIG_TOGGLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -420,15 +423,11 @@ func_door::Respawn(void)
|
|||
}
|
||||
|
||||
if (HasSpawnFlags(SF_MOV_USE)) {
|
||||
touch = __NULL__;
|
||||
PlayerUse = Use;
|
||||
} else {
|
||||
touch = Touch;
|
||||
PlayerUse = __NULL__;
|
||||
}
|
||||
|
||||
touch = Touch;
|
||||
|
||||
m_iValue = 0;
|
||||
m_iState = DOORSTATE_LOWERED;
|
||||
m_vecPos1 = GetSpawnOrigin();
|
||||
|
|
|
@ -100,7 +100,7 @@ class func_door_rotating:NSRenderableEntity
|
|||
virtual void(void) Away;
|
||||
virtual void(entity, int) Trigger;
|
||||
virtual void(void) Use;
|
||||
virtual void(void) Touch;
|
||||
virtual void(entity) Touch;
|
||||
virtual void(entity) Blocked;
|
||||
virtual void(void) SetMovementDirection;
|
||||
virtual void(vector angle, void(void) func) RotToDest;
|
||||
|
@ -301,7 +301,7 @@ func_door_rotating::Use(void)
|
|||
}
|
||||
|
||||
void
|
||||
func_door_rotating::Touch(void)
|
||||
func_door_rotating::Touch(entity eToucher)
|
||||
{
|
||||
if (m_iLocked || !GetMaster()) {
|
||||
if (m_flSoundWait < time)
|
||||
|
@ -318,8 +318,8 @@ func_door_rotating::Touch(void)
|
|||
if ((m_iState == STATE_UP) || (m_iState == STATE_DOWN))
|
||||
return;
|
||||
|
||||
if (other.movetype == MOVETYPE_WALK) {
|
||||
Trigger(other, TRIG_TOGGLE);
|
||||
if (eToucher.movetype == MOVETYPE_WALK) {
|
||||
Trigger(eToucher, TRIG_TOGGLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -405,10 +405,8 @@ func_door_rotating::Respawn(void)
|
|||
m_flWait = 0.01f;
|
||||
|
||||
if (HasSpawnFlags(SF_ROT_USE)) {
|
||||
touch = __NULL__;
|
||||
PlayerUse = Use;
|
||||
} else {
|
||||
touch = Touch;
|
||||
PlayerUse = __NULL__;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,12 +33,12 @@ class item_food:NSEntity
|
|||
void(void) item_food;
|
||||
|
||||
virtual void(void) Setup;
|
||||
virtual void(void) Touch;
|
||||
virtual void(entity) Touch;
|
||||
};
|
||||
|
||||
void item_food::Touch(void)
|
||||
void item_food::Touch(entity eToucher)
|
||||
{
|
||||
if (other.classname != "player") {
|
||||
if (eToucher.classname != "player") {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ void item_food::Touch(void)
|
|||
bevOwner.m_iReady = TRUE;
|
||||
}
|
||||
|
||||
Damage_Apply(other, this, -1, 0, DMG_GENERIC);
|
||||
Damage_Apply(eToucher, this, -1, 0, DMG_GENERIC);
|
||||
SetSolid(SOLID_NOT);
|
||||
remove(this);
|
||||
}
|
||||
|
@ -56,7 +56,6 @@ void item_food::Setup(void)
|
|||
{
|
||||
SetSolid(SOLID_TRIGGER);
|
||||
SetSize([-16,-16,-16], [16,16,16]);
|
||||
touch = Touch;
|
||||
|
||||
if (m_iIsCan) {
|
||||
sound(this, CHAN_ITEM, "weapons/g_bounce3.wav", 1.0f, ATTN_NORM);
|
||||
|
|
|
@ -50,7 +50,7 @@ class trigger_look:NSBrushTrigger
|
|||
|
||||
virtual void(float) Save;
|
||||
virtual void(string, string) Restore;
|
||||
virtual void(void) Touch;
|
||||
virtual void(entity) Touch;
|
||||
virtual void(void) Respawn;
|
||||
virtual void(string, string) SpawnKey;
|
||||
};
|
||||
|
@ -95,7 +95,7 @@ trigger_look::Restore(string strKey, string strValue)
|
|||
}
|
||||
|
||||
void
|
||||
trigger_look::Touch(void)
|
||||
trigger_look::Touch(entity eToucher)
|
||||
{
|
||||
float dot;
|
||||
entity lt;
|
||||
|
@ -103,7 +103,7 @@ trigger_look::Touch(void)
|
|||
if (GetMaster() == FALSE)
|
||||
return;
|
||||
|
||||
if (!(other.flags & FL_CLIENT)) {
|
||||
if (!(eToucher.flags & FL_CLIENT)) {
|
||||
/* FIXME: could this conflict with other entities? probably. */
|
||||
m_flLooked = 0.0f;
|
||||
return;
|
||||
|
@ -118,7 +118,7 @@ trigger_look::Touch(void)
|
|||
}
|
||||
|
||||
/* test against the looktarget position */
|
||||
makevectors(other.v_angle);
|
||||
makevectors(eToucher.v_angle);
|
||||
vector v = normalize (lt.origin - other.origin);
|
||||
dot = v * v_forward;
|
||||
|
||||
|
@ -138,9 +138,9 @@ trigger_look::Touch(void)
|
|||
SetSolid(SOLID_NOT);
|
||||
|
||||
if (!target)
|
||||
UseOutput(other, m_strOnTrigger);
|
||||
UseOutput(eToucher, m_strOnTrigger);
|
||||
else
|
||||
UseTargets(other, TRIG_TOGGLE, m_flDelay);
|
||||
UseTargets(eToucher, TRIG_TOGGLE, m_flDelay);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -47,7 +47,6 @@ enumflags
|
|||
class trigger_multiple:NSBrushTrigger
|
||||
{
|
||||
float m_flWait;
|
||||
entity m_eLastToucher;
|
||||
|
||||
/* Input/Output */
|
||||
string m_strOnStartTouch;
|
||||
|
@ -58,31 +57,18 @@ class trigger_multiple:NSBrushTrigger
|
|||
|
||||
virtual void(float) Save;
|
||||
virtual void(string, string) Restore;
|
||||
virtual void(void) touch;
|
||||
virtual void(entity) Touch;
|
||||
virtual void(void) Respawn;
|
||||
virtual void(string, string) SpawnKey;
|
||||
|
||||
virtual void(void) EndTouchCheck;
|
||||
virtual void(entity) EndTouch;
|
||||
};
|
||||
|
||||
void
|
||||
trigger_multiple::EndTouchCheck(void)
|
||||
trigger_multiple::EndTouch(entity eToucher)
|
||||
{
|
||||
if (m_eLastToucher) {
|
||||
tracebox(origin, absmin, absmax, origin, MOVE_NORMAL, this);
|
||||
if (!(trace_ent.flags & FL_CLIENT)) {
|
||||
UseOutput(other, m_strOnEndTouchAll);
|
||||
m_eLastToucher = __NULL__;
|
||||
}
|
||||
}
|
||||
|
||||
/* support for think/nextthink */
|
||||
if (think && nextthink > 0.0f) {
|
||||
if (nextthink < time) {
|
||||
nextthink = 0.0f;
|
||||
think();
|
||||
}
|
||||
}
|
||||
if (m_strOnEndTouchAll)
|
||||
UseOutput(eToucher, m_strOnEndTouchAll);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -117,15 +103,15 @@ trigger_multiple::Restore(string strKey, string strValue)
|
|||
}
|
||||
|
||||
void
|
||||
trigger_multiple::touch(void)
|
||||
trigger_multiple::Touch(entity eToucher)
|
||||
{
|
||||
if (GetMaster() == FALSE)
|
||||
return;
|
||||
if (HasSpawnFlags(TM_NOCLIENTS) && other.flags & FL_CLIENT)
|
||||
if (HasSpawnFlags(TM_NOCLIENTS) && eToucher.flags & FL_CLIENT)
|
||||
return;
|
||||
if (!HasSpawnFlags(TM_MONSTERS) && other.flags & FL_MONSTER)
|
||||
if (!HasSpawnFlags(TM_MONSTERS) && eToucher.flags & FL_MONSTER)
|
||||
return;
|
||||
if (!HasSpawnFlags(TM_PUSHABLES) && other.classname == "func_pushable")
|
||||
if (!HasSpawnFlags(TM_PUSHABLES) && eToucher.classname == "func_pushable")
|
||||
return;
|
||||
|
||||
if (Rules_IsTeamPlay() == TRUE) {
|
||||
|
@ -136,9 +122,9 @@ trigger_multiple::touch(void)
|
|||
|
||||
/* if the target key isn't used, assume we're using the new I/O system */
|
||||
if (!target)
|
||||
UseOutput(other, m_strOnStartTouch);
|
||||
UseOutput(eToucher, m_strOnStartTouch);
|
||||
else
|
||||
UseTargets(other, TRIG_TOGGLE, m_flDelay);
|
||||
UseTargets(eToucher, TRIG_TOGGLE, m_flDelay);
|
||||
|
||||
/* This is effectively a trigger_once...*/
|
||||
if (m_flWait != -1) {
|
||||
|
@ -147,17 +133,12 @@ trigger_multiple::touch(void)
|
|||
}
|
||||
|
||||
SetSolid(SOLID_NOT);
|
||||
m_eLastToucher = other;
|
||||
}
|
||||
|
||||
void
|
||||
trigger_multiple::Respawn(void)
|
||||
{
|
||||
InitBrushTrigger();
|
||||
|
||||
if (m_strOnEndTouchAll) {
|
||||
customphysics = EndTouchCheck;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -37,6 +37,11 @@ class NSEntity:NSTrigger
|
|||
PREDICTED_FLOAT_N(flags);
|
||||
PREDICTED_VECTOR_N(velocity);
|
||||
|
||||
/* not needed to be saved right now */
|
||||
float m_flTouchTime;
|
||||
bool m_beingTouched;
|
||||
entity m_eTouchLast;
|
||||
|
||||
#ifdef CLIENT
|
||||
virtual void(float,float) ReceiveEntity;
|
||||
virtual void(void) postdraw;
|
||||
|
@ -83,6 +88,7 @@ class NSEntity:NSTrigger
|
|||
nonvirtual string(void) GetSpawnModel;
|
||||
#endif
|
||||
|
||||
/* sets */
|
||||
virtual void(float) SetScale;
|
||||
virtual void(entity) SetOwner;
|
||||
virtual void(vector) SetVelocity;
|
||||
|
@ -92,11 +98,35 @@ class NSEntity:NSTrigger
|
|||
virtual void(string) SetModel;
|
||||
virtual void(float) SetModelindex;
|
||||
virtual void(float) SetMovetype;
|
||||
virtual void(float) SetGravity;
|
||||
virtual void(vector) SetAngles;
|
||||
virtual void(vector) SetAngularVelocity;
|
||||
virtual void(vector) SetOrigin;
|
||||
virtual void(vector, vector) SetSize;
|
||||
virtual void(float) AddFlags;
|
||||
virtual void(float) RemoveFlags;
|
||||
/* gets */
|
||||
virtual float(void) GetScale;
|
||||
virtual entity(void) GetOwner;
|
||||
virtual vector(void) GetVelocity;
|
||||
virtual float(void) GetSolid;
|
||||
virtual string(void) GetModel;
|
||||
virtual float(void) GetModelindex;
|
||||
virtual float(void) GetMovetype;
|
||||
virtual float(void) GetGravity;
|
||||
virtual vector(void) GetAngles;
|
||||
virtual vector(void) GetAngularVelocity;
|
||||
virtual vector(void) GetOrigin;
|
||||
virtual vector(void) GetMins;
|
||||
virtual vector(void) GetMaxs;
|
||||
virtual vector(void) GetRealMins;
|
||||
virtual vector(void) GetRealMaxs;
|
||||
virtual vector(void) GetAbsoluteMins;
|
||||
virtual vector(void) GetAbsoluteMaxs;
|
||||
virtual float(void) GetFlags;
|
||||
|
||||
virtual void(string, string) SpawnKey;
|
||||
nonvirtual void(void) Destroy;
|
||||
virtual void(void) Destroy;
|
||||
virtual void(void) UpdateBounds;
|
||||
|
||||
/* useful methods, based on GMod's API */
|
||||
|
@ -109,10 +139,14 @@ class NSEntity:NSTrigger
|
|||
nonvirtual float(void) WaterLevel;
|
||||
nonvirtual bool(entity) Visible;
|
||||
nonvirtual bool(vector) VisibleVec;
|
||||
nonvirtual entity(void) GetOwner;
|
||||
nonvirtual bool(float) HasSpawnFlags;
|
||||
nonvirtual bool(void) IsOnGround;
|
||||
nonvirtual entity(void) GetGroundEntity;
|
||||
virtual void(entity) Blocked;
|
||||
nonvirtual void(void) _BlockedHandler;
|
||||
nonvirtual void(void) BlockedHandler;
|
||||
|
||||
virtual void(entity) StartTouch;
|
||||
virtual void(entity) Touch;
|
||||
virtual void(entity) EndTouch;
|
||||
nonvirtual void(void) TouchHandler;
|
||||
};
|
||||
|
|
|
@ -136,12 +136,6 @@ NSEntity::Visible(entity ent)
|
|||
return (false);
|
||||
}
|
||||
|
||||
entity
|
||||
NSEntity::GetOwner(void)
|
||||
{
|
||||
return owner;
|
||||
}
|
||||
|
||||
bool
|
||||
NSEntity::HasSpawnFlags(float sf)
|
||||
{
|
||||
|
@ -173,11 +167,46 @@ NSEntity::Blocked(entity eBlocker)
|
|||
}
|
||||
|
||||
void
|
||||
NSEntity::_BlockedHandler(void)
|
||||
NSEntity::BlockedHandler(void)
|
||||
{
|
||||
Blocked(other);
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::Touch(entity eToucher)
|
||||
{
|
||||
/* To be handled by sub-classes */
|
||||
print("touched!\n");
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::StartTouch(entity eToucher)
|
||||
{
|
||||
/* To be handled by sub-classes */
|
||||
print("start touched!\n");
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::EndTouch(entity eToucher)
|
||||
{
|
||||
/* To be handled by sub-classes */
|
||||
print("end touched!\n");
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::TouchHandler(void)
|
||||
{
|
||||
/* start touch in case we haven't */
|
||||
if (m_beingTouched != true)
|
||||
StartTouch(other);
|
||||
|
||||
Touch(other);
|
||||
|
||||
m_flTouchTime = time;
|
||||
m_beingTouched = true;
|
||||
m_eTouchLast = other;
|
||||
}
|
||||
|
||||
#ifdef CLIENT
|
||||
/*
|
||||
============
|
||||
|
@ -442,6 +471,14 @@ NSEntity::ParentUpdate(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* handle end-touch */
|
||||
if (m_beingTouched == true)
|
||||
if (m_flTouchTime < time) {
|
||||
EndTouch(m_eTouchLast);
|
||||
m_beingTouched = false;
|
||||
m_eTouchLast = __NULL__;
|
||||
}
|
||||
}
|
||||
entity
|
||||
NSEntity::GetParent(void)
|
||||
|
@ -486,9 +523,6 @@ NSEntity::SetOwner(entity newOwner)
|
|||
void
|
||||
NSEntity::SetVelocity(vector vecNew)
|
||||
{
|
||||
if (vecNew == velocity)
|
||||
return;
|
||||
|
||||
velocity = vecNew;
|
||||
};
|
||||
|
||||
|
@ -512,25 +546,23 @@ NSEntity::SetSendFlags(float flSendFlags)
|
|||
void
|
||||
NSEntity::SetMovetype(float newMovetype)
|
||||
{
|
||||
if (newMovetype == movetype)
|
||||
return;
|
||||
|
||||
movetype = newMovetype;
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::SetGravity(float newGrav)
|
||||
{
|
||||
gravity = newGrav;
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::SetSolid(float newSolid)
|
||||
{
|
||||
if (newSolid == solid)
|
||||
return;
|
||||
|
||||
solid = newSolid;
|
||||
}
|
||||
void
|
||||
NSEntity::SetScale(float newScale)
|
||||
{
|
||||
if (newScale == scale)
|
||||
return;
|
||||
|
||||
scale = newScale;
|
||||
}
|
||||
|
||||
|
@ -582,12 +614,15 @@ NSEntity::UpdateBounds(void)
|
|||
void
|
||||
NSEntity::SetAngles(vector newAngles)
|
||||
{
|
||||
if (newAngles == angles)
|
||||
return;
|
||||
|
||||
angles = newAngles;
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::SetAngularVelocity(vector newAvel)
|
||||
{
|
||||
avelocity = newAvel;
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::SetSize(vector newMins, vector newMaxs)
|
||||
{
|
||||
|
@ -606,9 +641,6 @@ NSEntity::SetSize(vector newMins, vector newMaxs)
|
|||
void
|
||||
NSEntity::SetOrigin(vector newOrigin)
|
||||
{
|
||||
if (newOrigin == origin)
|
||||
return;
|
||||
|
||||
setorigin(this, newOrigin);
|
||||
}
|
||||
|
||||
|
@ -631,6 +663,127 @@ NSEntity::SetModelindex(float newModelIndex)
|
|||
SetSize(mins, maxs);
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::AddFlags(float fl)
|
||||
{
|
||||
flags |= fl;
|
||||
}
|
||||
|
||||
void
|
||||
NSEntity::RemoveFlags(float fl)
|
||||
{
|
||||
flags &= ~fl;
|
||||
}
|
||||
|
||||
float
|
||||
NSEntity::GetScale(void)
|
||||
{
|
||||
return scale;
|
||||
}
|
||||
|
||||
entity
|
||||
NSEntity::GetOwner(void)
|
||||
{
|
||||
return owner;
|
||||
}
|
||||
|
||||
vector
|
||||
NSEntity::GetVelocity(void)
|
||||
{
|
||||
return velocity;
|
||||
}
|
||||
|
||||
float
|
||||
NSEntity::GetSolid(void)
|
||||
{
|
||||
return solid;
|
||||
}
|
||||
|
||||
string
|
||||
NSEntity::GetModel(void)
|
||||
{
|
||||
return model;
|
||||
}
|
||||
|
||||
float
|
||||
NSEntity::GetModelindex(void)
|
||||
{
|
||||
return modelindex;
|
||||
}
|
||||
|
||||
float
|
||||
NSEntity::GetMovetype(void)
|
||||
{
|
||||
return movetype;
|
||||
}
|
||||
|
||||
float
|
||||
NSEntity::GetGravity(void)
|
||||
{
|
||||
return gravity;
|
||||
}
|
||||
|
||||
vector
|
||||
NSEntity::GetAngles(void)
|
||||
{
|
||||
return angles;
|
||||
}
|
||||
|
||||
vector
|
||||
NSEntity::GetAngularVelocity(void)
|
||||
{
|
||||
return avelocity;
|
||||
}
|
||||
|
||||
vector
|
||||
NSEntity::GetOrigin(void)
|
||||
{
|
||||
return origin;
|
||||
}
|
||||
|
||||
vector
|
||||
NSEntity::GetMins(void)
|
||||
{
|
||||
return mins;
|
||||
}
|
||||
|
||||
vector
|
||||
NSEntity::GetMaxs(void)
|
||||
{
|
||||
return maxs;
|
||||
}
|
||||
|
||||
vector
|
||||
NSEntity::GetRealMins(void)
|
||||
{
|
||||
return m_vecMins;
|
||||
}
|
||||
|
||||
vector
|
||||
NSEntity::GetRealMaxs(void)
|
||||
{
|
||||
return m_vecMaxs;
|
||||
}
|
||||
|
||||
vector
|
||||
NSEntity::GetAbsoluteMins(void)
|
||||
{
|
||||
return absmin;
|
||||
}
|
||||
|
||||
vector
|
||||
NSEntity::GetAbsoluteMaxs(void)
|
||||
{
|
||||
return absmax;
|
||||
}
|
||||
|
||||
float
|
||||
NSEntity::GetFlags(void)
|
||||
{
|
||||
return flags;
|
||||
}
|
||||
|
||||
|
||||
#ifdef SERVER
|
||||
vector
|
||||
NSEntity::GetSpawnOrigin(void)
|
||||
|
@ -870,7 +1023,8 @@ NSEntity::NSEntity(void)
|
|||
m_oldOrigin = origin;
|
||||
m_oldSolid = solid;
|
||||
m_oldModel = Util_FixModel(model);
|
||||
blocked = _BlockedHandler;
|
||||
blocked = BlockedHandler;
|
||||
touch = TouchHandler;
|
||||
|
||||
/* Input/Output system */
|
||||
m_strOnTrigger = CreateOutput(m_strOnTrigger);
|
||||
|
|
Loading…
Reference in a new issue