CBaseEntity: Add reliable methods to query what certain attributes where
when the entity first spawned. (e.g. GetSpawnOrigin())
This commit is contained in:
parent
cba54d3e2b
commit
56a616ec8b
44 changed files with 165 additions and 146 deletions
|
@ -531,9 +531,10 @@ CBaseMonster::Hide(void)
|
|||
void
|
||||
CBaseMonster::Respawn(void)
|
||||
{
|
||||
v_angle[0] = Math_FixDelta(m_oldAngle[0]);
|
||||
v_angle[1] = Math_FixDelta(m_oldAngle[1]);
|
||||
v_angle[2] = Math_FixDelta(m_oldAngle[2]);
|
||||
v_angle = GetSpawnAngles();
|
||||
v_angle[0] = Math_FixDelta(v_angle[0]);
|
||||
v_angle[1] = Math_FixDelta(v_angle[1]);
|
||||
v_angle[2] = Math_FixDelta(v_angle[2]);
|
||||
flags |= FL_MONSTER;
|
||||
takedamage = DAMAGE_YES;
|
||||
iBleeds = TRUE;
|
||||
|
@ -548,9 +549,9 @@ CBaseMonster::Respawn(void)
|
|||
SetAngles(v_angle);
|
||||
SetSolid(SOLID_SLIDEBOX);
|
||||
SetMovetype(MOVETYPE_WALK);
|
||||
SetModel(m_oldModel);
|
||||
SetModel(GetSpawnModel());
|
||||
SetSize(base_mins, base_maxs);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
|
||||
droptofloor();
|
||||
}
|
||||
|
|
|
@ -201,14 +201,14 @@ CBasePhysics::Respawn(void)
|
|||
{
|
||||
SetMovetype(MOVETYPE_PHYSICS);
|
||||
SetSolid(SOLID_PHYSICS_BOX + m_iShape);
|
||||
SetModel(m_oldModel);
|
||||
SetModel(GetSpawnModel());
|
||||
geomtype = GEOMTYPE_BOX;
|
||||
takedamage = DAMAGE_YES;
|
||||
health = 100000;
|
||||
PhysicsDisable();
|
||||
SetFriction(2.0f);
|
||||
SetBounceFactor(0.25f);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
|
||||
/* don't let players collide */
|
||||
dimension_solid = 1;
|
||||
|
|
|
@ -55,8 +55,8 @@ button_target::Respawn(void)
|
|||
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetSolid(SOLID_BSP);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
|
||||
/* it's either one or the other */
|
||||
if (spawnflags & BUTTA_USE) {
|
||||
|
|
10
src/gs-entbase/server/func_breakable.qc
Executable file → Normal file
10
src/gs-entbase/server/func_breakable.qc
Executable file → Normal file
|
@ -187,7 +187,7 @@ func_breakable::Death(void)
|
|||
callfunction(self.classname);
|
||||
|
||||
/* apply the saved values back */
|
||||
t.origin = t.m_oldOrigin = neworg;
|
||||
t.origin = t.GetSpawnOrigin() = neworg;
|
||||
|
||||
/* spawn anew */
|
||||
if (t.Respawn)
|
||||
|
@ -284,8 +284,8 @@ func_breakable::Respawn(void)
|
|||
SetMovetype(MOVETYPE_NONE);
|
||||
SetSolid(SOLID_BSP);
|
||||
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
touch = PlayerTouch;
|
||||
think = __NULL__;
|
||||
|
||||
|
@ -295,7 +295,7 @@ func_breakable::Respawn(void)
|
|||
takedamage = DAMAGE_YES;
|
||||
}
|
||||
|
||||
health = m_oldHealth;
|
||||
health = GetSpawnHealth();
|
||||
|
||||
if (!health) {
|
||||
health = 15;
|
||||
|
@ -338,7 +338,7 @@ func_breakable::func_breakable(void)
|
|||
CBaseTrigger::CBaseTrigger();
|
||||
|
||||
/* contrary to what some map designers think, angles are not supported */
|
||||
m_oldAngle = angles = [0,0,0];
|
||||
GetSpawnAngles() = angles = [0,0,0];
|
||||
|
||||
switch (m_iMaterial) {
|
||||
case BREAKMT_GLASS:
|
||||
|
|
|
@ -80,13 +80,13 @@ func_brush::Trigger(entity act, int state)
|
|||
SetModelindex(0);
|
||||
break;
|
||||
case TRIG_ON:
|
||||
SetModel(m_oldModel);
|
||||
SetModel(GetSpawnModel());
|
||||
break;
|
||||
default:
|
||||
if (modelindex != 0)
|
||||
SetModelindex(0);
|
||||
else
|
||||
SetModel(m_oldModel);
|
||||
SetModel(GetSpawnModel());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -114,8 +114,8 @@ void
|
|||
func_brush::Respawn(void)
|
||||
{
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
|
||||
/* make sure solid and so on are set */
|
||||
if (m_iStartOff) {
|
||||
|
|
|
@ -231,7 +231,7 @@ func_button::Trigger(entity act, int state)
|
|||
|
||||
UseOutput(act, m_strOnPressed);
|
||||
UseTargets(act, TRIG_TOGGLE, m_flDelay);
|
||||
health = m_oldHealth;
|
||||
health = GetSpawnHealth();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -277,12 +277,12 @@ func_button::Blocked(void)
|
|||
void
|
||||
func_button::SetMovementDirection(void)
|
||||
{
|
||||
if (m_oldAngle == [0,-1,0]) {
|
||||
if (GetSpawnAngles() == [0,-1,0]) {
|
||||
m_vecMoveDir = [0,0,1];
|
||||
} else if (m_oldAngle == [0,-2,0]) {
|
||||
} else if (GetSpawnAngles() == [0,-2,0]) {
|
||||
m_vecMoveDir = [0,0,-1];
|
||||
} else {
|
||||
makevectors(m_oldAngle);
|
||||
makevectors(GetSpawnAngles());
|
||||
m_vecMoveDir = v_forward;
|
||||
}
|
||||
}
|
||||
|
@ -327,13 +327,13 @@ func_button::Respawn(void)
|
|||
|
||||
SetSolid(SOLID_BSP);
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetModel(GetSpawnModel());
|
||||
|
||||
blocked = Blocked;
|
||||
velocity = [0,0,0];
|
||||
nextthink = -1;
|
||||
health = m_oldHealth;
|
||||
health = GetSpawnHealth();
|
||||
|
||||
if (health > 0) {
|
||||
takedamage = DAMAGE_YES;
|
||||
|
@ -352,7 +352,7 @@ func_button::Respawn(void)
|
|||
PlayerUse = Use;
|
||||
}
|
||||
|
||||
m_vecPos1 = m_oldOrigin;
|
||||
m_vecPos1 = GetSpawnOrigin();
|
||||
|
||||
if (spawnflags & SF_BTT_NOMOVE) {
|
||||
m_vecPos2 = m_vecPos1;
|
||||
|
|
|
@ -74,13 +74,13 @@ void
|
|||
func_conveyor::Respawn(void)
|
||||
{
|
||||
m_vecMoveDir = [0,0,0];
|
||||
angles = m_oldAngle;
|
||||
angles = GetSpawnAngles();
|
||||
|
||||
SetMovementDirection();
|
||||
SetSolid(SOLID_BSP);
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
|
||||
/* TODO: Apply some effect flag the engine handles? */
|
||||
if (!(spawnflags & SF_CONVEYOR_VISUAL)) {
|
||||
|
|
|
@ -292,12 +292,12 @@ func_door::Blocked(void)
|
|||
void
|
||||
func_door::SetMovementDirection(void)
|
||||
{
|
||||
if (m_oldAngle == [0,-1,0]) {
|
||||
if (GetSpawnAngles() == [0,-1,0]) {
|
||||
m_vecMoveDir = [0,0,1];
|
||||
} else if (m_oldAngle == [0,-2,0]) {
|
||||
} else if (GetSpawnAngles() == [0,-2,0]) {
|
||||
m_vecMoveDir = [0,0,-1];
|
||||
} else {
|
||||
makevectors(m_oldAngle);
|
||||
makevectors(GetSpawnAngles());
|
||||
m_vecMoveDir = v_forward;
|
||||
}
|
||||
}
|
||||
|
@ -355,8 +355,8 @@ func_door::Respawn(void)
|
|||
SetSolid(SOLID_BSP);
|
||||
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
blocked = Blocked;
|
||||
think = __NULL__;
|
||||
nextthink = 0.0f;
|
||||
|
@ -386,7 +386,7 @@ func_door::Respawn(void)
|
|||
|
||||
m_iValue = 0;
|
||||
m_iState = DOORSTATE_LOWERED;
|
||||
m_vecPos1 = m_oldOrigin;
|
||||
m_vecPos1 = GetSpawnOrigin();
|
||||
m_vecPos2 = (m_vecPos1 + m_vecMoveDir * (fabs(m_vecMoveDir * size) - m_flLip));
|
||||
|
||||
if (spawnflags & SF_MOV_OPEN) {
|
||||
|
|
|
@ -360,8 +360,8 @@ void func_door_rotating::Respawn(void)
|
|||
|
||||
SetSolid(SOLID_BSP);
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
think = __NULL__;
|
||||
nextthink = 0.0f;
|
||||
avelocity = [0,0,0];
|
||||
|
@ -377,12 +377,12 @@ void func_door_rotating::Respawn(void)
|
|||
}
|
||||
|
||||
m_iState = STATE_LOWERED;
|
||||
m_vecPos1 = m_oldAngle;
|
||||
m_vecPos1 = GetSpawnAngles();
|
||||
|
||||
if (spawnflags & SF_ROT_BACKWARDS) {
|
||||
m_vecPos2 = m_oldAngle + m_vecMoveDir * -m_flDistance;
|
||||
m_vecPos2 = GetSpawnAngles() + m_vecMoveDir * -m_flDistance;
|
||||
} else {
|
||||
m_vecPos2 = m_oldAngle + m_vecMoveDir * m_flDistance;
|
||||
m_vecPos2 = GetSpawnAngles() + m_vecMoveDir * m_flDistance;
|
||||
}
|
||||
|
||||
if (spawnflags & SF_ROT_OPEN) {
|
||||
|
|
|
@ -171,8 +171,8 @@ func_guntarget::Respawn(void)
|
|||
|
||||
SetSolid(SOLID_BSP);
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
|
||||
if (spawnflags & SF_GUNTARGET_ON) {
|
||||
think = ThinkWrap;
|
||||
|
|
|
@ -174,8 +174,8 @@ func_mortar_field::Respawn(void)
|
|||
{
|
||||
SetMovetype(MOVETYPE_NONE);
|
||||
SetSolid(SOLID_NOT);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
|
||||
#ifdef GS_RENDERFX
|
||||
SetRenderMode(RM_TRIGGER);
|
||||
|
|
|
@ -112,7 +112,7 @@ func_pendulum::Respawn(void)
|
|||
SetSolid(SOLID_BSP);
|
||||
|
||||
movetype = MOVETYPE_PUSH;
|
||||
SetModel(m_oldModel);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(origin);
|
||||
}
|
||||
|
||||
|
|
|
@ -97,9 +97,9 @@ void
|
|||
func_plat::MoveToggle(void)
|
||||
{
|
||||
if (m_iState == PLATSTATE_RAISED) {
|
||||
Move(m_oldOrigin - [0,0,m_flHeight], ArrivedDown);
|
||||
Move(GetSpawnOrigin() - [0,0,m_flHeight], ArrivedDown);
|
||||
} else if (m_iState == PLATSTATE_LOWERED) {
|
||||
Move(m_oldOrigin, ArrivedUp);
|
||||
Move(GetSpawnOrigin(), ArrivedUp);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,10 +111,10 @@ func_plat::Trigger(entity act, int state)
|
|||
|
||||
switch (state) {
|
||||
case TRIG_OFF:
|
||||
Move(m_oldOrigin - [0,0,m_flHeight], ArrivedDown);
|
||||
Move(GetSpawnOrigin() - [0,0,m_flHeight], ArrivedDown);
|
||||
break;
|
||||
case TRIG_ON:
|
||||
Move(m_oldOrigin, ArrivedUp);
|
||||
Move(GetSpawnOrigin(), ArrivedUp);
|
||||
break;
|
||||
default:
|
||||
MoveToggle();
|
||||
|
@ -136,8 +136,8 @@ func_plat::Respawn(void)
|
|||
{
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetSolid(SOLID_BSP);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
|
||||
m_iState = PLATSTATE_RAISED;
|
||||
think = __NULL__;
|
||||
|
|
|
@ -144,7 +144,7 @@ func_rot_button::TurnToggle(void)
|
|||
if (m_iState == ROTBTNSTATE_OPENED) {
|
||||
Rotate(m_vecMoveAngle, ArrivedClosed);
|
||||
} else if (m_iState == ROTBTNSTATE_CLOSED) {
|
||||
Rotate(m_oldAngle, ArrivedOpened);
|
||||
Rotate(GetSpawnAngles(), ArrivedOpened);
|
||||
|
||||
/* in toggle mode, we trigger our targets every turn */
|
||||
if (spawnflags & FNCROTBUT_TOGGLE)
|
||||
|
@ -169,9 +169,9 @@ func_rot_button::Respawn(void)
|
|||
else
|
||||
SetSolid(SOLID_BSP);
|
||||
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetAngles(m_oldAngle);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetAngles(GetSpawnAngles());
|
||||
PlayerUse = OnPlayerUse;
|
||||
|
||||
m_iState = ROTBTNSTATE_OPENED;
|
||||
|
|
|
@ -190,9 +190,9 @@ func_tank::Respawn(void)
|
|||
{
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetSolid(SOLID_BSP);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetAngles(m_oldAngle);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetAngles(GetSpawnAngles());
|
||||
|
||||
if (m_eDriver)
|
||||
PlayerLeave((base_player)m_eDriver);
|
||||
|
|
|
@ -65,8 +65,8 @@ func_tankcontrols::Respawn(void)
|
|||
{
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetSolid(SOLID_BSP);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
PlayerUse = OnPlayerUse;
|
||||
|
||||
#ifdef GS_RENDERFX
|
||||
|
|
|
@ -237,8 +237,8 @@ func_tracktrain::Respawn(void)
|
|||
SetSolid(spawnflags & TRAIN_NOTSOLID ? SOLID_NOT : SOLID_BSP);
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
blocked = Blocked;
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
m_flSpeed = m_flStartSpeed;
|
||||
|
||||
/* let's wait 1/4 a second to give the path_corner entities a chance to
|
||||
|
|
|
@ -226,8 +226,8 @@ func_train::Respawn(void)
|
|||
SetSolid(spawnflags & TRAIN_NOTSOLID ? SOLID_NOT : SOLID_BSP);
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
blocked = Blocked;
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
|
||||
/* let's wait 1/4 a second to give the path_corner entities a chance to
|
||||
* spawn in case they're after us in the ent lump */
|
||||
|
|
|
@ -484,7 +484,7 @@ func_vehicle::Realign(void)
|
|||
angles = vectoangles(first.origin - second.origin);
|
||||
|
||||
end_pos = first.origin;
|
||||
end_pos[2] = m_oldOrigin[2] + 64;
|
||||
end_pos[2] = GetSpawnOrigin()[2] + 64;
|
||||
setorigin(this, end_pos);
|
||||
}
|
||||
}
|
||||
|
@ -494,9 +494,9 @@ func_vehicle::Respawn(void)
|
|||
{
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetSolid(SOLID_BSP);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetAngles(m_oldAngle);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetAngles(GetSpawnAngles());
|
||||
think = Realign;
|
||||
nextthink = time + 0.1f;
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ func_wall_toggle::Respawn(void)
|
|||
{
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetSolid(SOLID_BSP);
|
||||
SetModel(m_oldModel);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(origin);
|
||||
m_iVisible = 1;
|
||||
m_oldmodelindex = modelindex;
|
||||
|
|
|
@ -66,7 +66,7 @@ game_player_equip::SpawnUnit(string cname, vector org)
|
|||
callfunction(self.classname);
|
||||
|
||||
/* apply the saved values back */
|
||||
t.origin = t.m_oldOrigin = neworg;
|
||||
t.origin = t.GetSpawnOrigin() = neworg;
|
||||
|
||||
/* spawn anew */
|
||||
t.Respawn();
|
||||
|
|
|
@ -81,12 +81,12 @@ momentary_door::customphysics(void)
|
|||
void
|
||||
momentary_door::SetMovementDirection(void)
|
||||
{
|
||||
if (m_oldAngle == [0,-1,0]) {
|
||||
if (GetSpawnAngles() == [0,-1,0]) {
|
||||
m_vecMoveDir = [0,0,1];
|
||||
} else if (m_oldAngle == [0,-2,0]) {
|
||||
} else if (GetSpawnAngles() == [0,-2,0]) {
|
||||
m_vecMoveDir = [0,0,-1];
|
||||
} else {
|
||||
makevectors(m_oldAngle);
|
||||
makevectors(GetSpawnAngles());
|
||||
m_vecMoveDir = v_forward;
|
||||
}
|
||||
}
|
||||
|
@ -96,12 +96,12 @@ momentary_door::Respawn(void)
|
|||
{
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetSolid(SOLID_BSP);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetMovementDirection();
|
||||
SetAngles([0,0,0]);
|
||||
|
||||
m_vecPos1 = m_oldOrigin;
|
||||
m_vecPos1 = GetSpawnOrigin();
|
||||
m_vecPos2 = (m_vecPos1 + m_vecMoveDir * (fabs(m_vecMoveDir * size) - m_flDistance));
|
||||
}
|
||||
|
||||
|
|
|
@ -127,14 +127,14 @@ momentary_rot_button::Respawn(void)
|
|||
{
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetSolid(SOLID_BSP);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetMovementDirection();
|
||||
SetAngles([0,0,0]);
|
||||
PlayerUse = OnPlayerUse;
|
||||
|
||||
m_vecPos1 = [0,0,0];
|
||||
m_vecPos2 = m_oldAngle + m_vecMoveDir * m_flDistance;
|
||||
m_vecPos2 = GetSpawnAngles() + m_vecMoveDir * m_flDistance;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -49,9 +49,9 @@ monster_furniture::Respawn(void)
|
|||
{
|
||||
SetMovetype(MOVETYPE_NOCLIP);
|
||||
SetSolid(SOLID_NOT);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetAngles(m_oldAngle);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetAngles(GetSpawnAngles());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -94,8 +94,8 @@ monstermaker::Spawner(void)
|
|||
callfunction(self.classname);
|
||||
|
||||
/* apply the saved values back */
|
||||
t.origin = t.m_oldOrigin = neworg;
|
||||
t.angles = t.m_oldAngle = newang;
|
||||
t.origin = t.GetSpawnOrigin() = neworg;
|
||||
t.angles = t.GetSpawnAngles() = newang;
|
||||
t.targetname = tname;
|
||||
t.spawnflags |= MSF_MULTIPLAYER;
|
||||
|
||||
|
|
|
@ -115,8 +115,8 @@ point_camera::Respawn(void)
|
|||
SetModelindex(0);
|
||||
SetSolid(SOLID_NOT);
|
||||
SetSize([-16,-16,-16], [16,16,16]);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetAngles(m_oldAngle);
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetAngles(GetSpawnAngles());
|
||||
m_iValue = TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -101,12 +101,12 @@ prop_door_rotating::Interact(void)
|
|||
void
|
||||
prop_door_rotating::Respawn(void)
|
||||
{
|
||||
SetModel(m_oldModel);
|
||||
SetModel(GetSpawnModel());
|
||||
SetSolid(SOLID_BSP);
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
PlayerUse = Interact;
|
||||
m_vecDest1 = m_oldAngle;
|
||||
m_vecDest1 = GetSpawnAngles();
|
||||
m_vecDest2 = m_vecDest1 + [0, m_flDistance, 0];
|
||||
}
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ speaker::Respawn(void)
|
|||
{
|
||||
/* force this thing to be networked */
|
||||
SetModel("models/player.mdl");
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
|
||||
#ifdef GS_RENDERFX
|
||||
SetRenderMode(RM_COLOR);
|
||||
|
|
|
@ -76,9 +76,9 @@ This entity was introduced in Quake (1996).
|
|||
|
||||
CLASSEXPORT(info_node, info_notnull)
|
||||
CLASSEXPORT(info_target, info_notnull)
|
||||
CLASSEXPORT(env_sound, info_null)
|
||||
CLASSEXPORT(env_sun, info_null)
|
||||
CLASSEXPORT(info_intermission, info_null)
|
||||
CLASSEXPORT(env_sound, info_notnull)
|
||||
CLASSEXPORT(env_sun, info_notnull)
|
||||
CLASSEXPORT(info_intermission, info_notnull)
|
||||
|
||||
void
|
||||
env_glow(void)
|
||||
|
|
|
@ -53,12 +53,12 @@ class trigger_push:CBaseTrigger
|
|||
void
|
||||
trigger_push::SetMovementDirection(void)
|
||||
{
|
||||
if (m_oldAngle == [0,-1,0]) {
|
||||
if (GetSpawnAngles() == [0,-1,0]) {
|
||||
m_vecMoveDir = [0,0,1];
|
||||
} else if (angles == [0,-2,0]) {
|
||||
m_vecMoveDir = [0,0,-1];
|
||||
} else {
|
||||
makevectors(m_oldAngle);
|
||||
makevectors(GetSpawnAngles());
|
||||
m_vecMoveDir = v_forward;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,12 @@ class CBaseEntity
|
|||
|
||||
string m_parent;
|
||||
|
||||
/* Reliable APIs */
|
||||
virtual vector(void) GetSpawnOrigin;
|
||||
virtual vector(void) GetSpawnAngles;
|
||||
virtual string(void) GetSpawnModel;
|
||||
virtual float(void) GetSpawnHealth;
|
||||
|
||||
/* Input/Output System */
|
||||
string m_strOnTrigger;
|
||||
string m_strOnUser1;
|
||||
|
@ -121,4 +127,6 @@ class CBaseEntity
|
|||
#endif
|
||||
};
|
||||
|
||||
#ifdef CLIENT
|
||||
class CBaseTrigger:CBaseEntity {};
|
||||
#endif
|
|
@ -825,11 +825,11 @@ CBaseEntity::SpawnInit(void)
|
|||
void
|
||||
CBaseEntity::Respawn(void)
|
||||
{
|
||||
health = m_oldHealth;
|
||||
SetModel(m_oldModel);
|
||||
health = GetSpawnHealth();
|
||||
SetModel(GetSpawnModel());
|
||||
SetSolid(m_oldSolid);
|
||||
SetAngles(m_oldAngle);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetAngles(GetSpawnAngles());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
target = m_oldstrTarget;
|
||||
|
||||
#ifdef GS_RENDERFX
|
||||
|
@ -902,7 +902,7 @@ CBaseEntity::CBaseEntity(void)
|
|||
m_oldstrTarget = target;
|
||||
|
||||
if (m_oldModel != "") {
|
||||
precache_model(m_oldModel);
|
||||
precache_model(GetSpawnModel());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1065,6 +1065,29 @@ CBaseEntity::SetRenderColor(vector newColor)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef SERVER
|
||||
vector
|
||||
CBaseEntity::GetSpawnOrigin(void)
|
||||
{
|
||||
return m_oldOrigin;
|
||||
}
|
||||
vector
|
||||
CBaseEntity::GetSpawnAngles(void)
|
||||
{
|
||||
return m_oldAngle;
|
||||
}
|
||||
string
|
||||
CBaseEntity::GetSpawnModel(void)
|
||||
{
|
||||
return m_oldModel;
|
||||
}
|
||||
float
|
||||
CBaseEntity::GetSpawnHealth(void)
|
||||
{
|
||||
return m_oldHealth;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
============
|
||||
CBaseEntity::SpawnKey
|
||||
|
@ -1146,6 +1169,7 @@ CBaseEntity::SpawnKey(string strKey, string strValue)
|
|||
case "model":
|
||||
model = strValue;
|
||||
break;
|
||||
case "zhlt_lightflags":
|
||||
case "classname":
|
||||
case "spawnflags":
|
||||
break;
|
||||
|
@ -1182,7 +1206,7 @@ CBaseEntity::SpawnKey(string strKey, string strValue)
|
|||
break;
|
||||
#endif
|
||||
default:
|
||||
print(sprintf("^3%s^7::SpawnKey:: Unknown key '%s' with value '%s'\n",
|
||||
dprint(sprintf("^3%s^7::SpawnKey:: Unknown key '%s' with value '%s'\n",
|
||||
classname, strKey, strValue));
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ class env_projectedtexture:CBaseTrigger
|
|||
virtual float(entity, float) SendEntity;
|
||||
virtual void(string, string) SpawnKey;
|
||||
virtual void(entity, string, string) Input;
|
||||
virtual void(void) ParentUpdate;
|
||||
virtual void(void) EvaluateEntity;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -157,7 +157,7 @@ env_projectedtexture::ReceiveEntity(float flFlags)
|
|||
}
|
||||
#else
|
||||
void
|
||||
env_projectedtexture::ParentUpdate(void)
|
||||
env_projectedtexture::EvaluateEntity(void)
|
||||
{
|
||||
if (net_origin != origin) {
|
||||
net_origin = origin;
|
||||
|
@ -167,16 +167,6 @@ env_projectedtexture::ParentUpdate(void)
|
|||
net_angles = angles;
|
||||
SendFlags |= PRTEXFL_CHANGED_ANGLES;
|
||||
}
|
||||
|
||||
if (m_parent) {
|
||||
entity p = find(world, ::targetname, m_parent);
|
||||
|
||||
if (p) {
|
||||
CBaseEntity t = (CBaseEntity)p;
|
||||
vector ofs = m_oldOrigin - t.m_oldOrigin;
|
||||
SetOrigin(p.origin + ofs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -324,8 +314,8 @@ env_projectedtexture::Respawn(void)
|
|||
{
|
||||
SetSolid(SOLID_NOT);
|
||||
SetSize([-16,-16,-16], [16,16,16]);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetAngles(m_oldAngle);
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetAngles(GetSpawnAngles());
|
||||
|
||||
m_iState = (spawnflags & 1) ? 1 : 0;
|
||||
}
|
||||
|
|
|
@ -84,8 +84,8 @@ func_illusionary::Respawn(void)
|
|||
SetAngles([0,0,0]);
|
||||
SetMovetype(MOVETYPE_NONE);
|
||||
SetSolid(SOLID_NOT);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetSkin(0);
|
||||
|
||||
// TODO: Add support for (skin) -1 = Empty, -7 = Volumetric light
|
||||
|
|
|
@ -82,8 +82,8 @@ func_ladder::Respawn(void)
|
|||
SetMovetype(MOVETYPE_NONE);
|
||||
SetSolid(SOLID_BSP);
|
||||
SetSkin(CONTENT_LADDER);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetFrame(0);
|
||||
#ifdef GS_RENDERFX
|
||||
SetRenderMode(RM_TRIGGER);
|
||||
|
|
|
@ -325,9 +325,9 @@ func_monitor::Respawn(void)
|
|||
{
|
||||
SetSolid(SOLID_BSP);
|
||||
SetMovetype(MOVETYPE_NONE);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetAngles(m_oldAngle);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetAngles(GetSpawnAngles());
|
||||
SetModel(GetSpawnModel());
|
||||
m_iValue = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -362,9 +362,9 @@ func_tankmortar::Respawn(void)
|
|||
{
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetSolid(SOLID_BSP);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetAngles(m_oldAngle);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetAngles(GetSpawnAngles());
|
||||
|
||||
if (m_eDriver)
|
||||
PlayerLeave((base_player)m_eDriver);
|
||||
|
|
|
@ -84,8 +84,8 @@ func_wall::Respawn(void)
|
|||
SetAngles([0,0,0]);
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetSolid(SOLID_BSP);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetFrame(0);
|
||||
}
|
||||
#else
|
||||
|
|
|
@ -237,8 +237,8 @@ info_particle_system::Respawn(void)
|
|||
{
|
||||
SetSolid(SOLID_NOT);
|
||||
SetSize([-16,-16,-16], [16,16,16]);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetAngles(m_oldAngle);
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetAngles(GetSpawnAngles());
|
||||
|
||||
if (spawnflags & PSFL_STARTACTIVE) {
|
||||
Trigger(this, TRIG_ON);
|
||||
|
|
|
@ -312,8 +312,8 @@ light_dynamic::Respawn(void)
|
|||
{
|
||||
SetSolid(SOLID_NOT);
|
||||
SetSize([-16,-16,-16], [16,16,16]);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetAngles(m_oldAngle);
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
SetAngles(GetSpawnAngles());
|
||||
|
||||
m_iState = (m_iStartActive == 1) ? 1 : 0;
|
||||
}
|
||||
|
|
|
@ -476,9 +476,9 @@ prop_vehicle_driveable::Respawn(void)
|
|||
{
|
||||
SetMovetype(MOVETYPE_NONE);
|
||||
SetSolid(SOLID_BBOX);
|
||||
SetOrigin(m_oldOrigin + [0,0,32]);
|
||||
SetAngles(m_oldAngle);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(GetSpawnOrigin() + [0,0,32]);
|
||||
SetAngles(GetSpawnAngles());
|
||||
SetModel(GetSpawnModel());
|
||||
|
||||
m_flBRWheelAxel = gettagindex( this, "RRWheelAxel" );
|
||||
m_flBLWheelAxel = gettagindex( this, "RLWheelAxel" );
|
||||
|
|
|
@ -235,7 +235,7 @@ trigger_camera::Trigger(entity act, int state)
|
|||
{
|
||||
m_eLooker = act;
|
||||
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
velocity = [0,0,0];
|
||||
think = __NULL__;
|
||||
nextthink = 0.0f;
|
||||
|
@ -250,8 +250,8 @@ trigger_camera::Respawn(void)
|
|||
{
|
||||
SetSolid(SOLID_NOT);
|
||||
SetMovetype(MOVETYPE_PUSH);
|
||||
SetModel(m_oldModel);
|
||||
SetOrigin(m_oldOrigin);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -359,7 +359,6 @@ games_check_gtxt(int id, string gamedirname)
|
|||
games[id].type = argv(1);
|
||||
break;
|
||||
}
|
||||
print(sprintf("GameInfo: %s\n", temp));
|
||||
} else if (braced == 2) {
|
||||
/* FileSystem */
|
||||
switch (token) {
|
||||
|
@ -368,7 +367,6 @@ games_check_gtxt(int id, string gamedirname)
|
|||
case "toolsappid":
|
||||
break;
|
||||
}
|
||||
print(sprintf("FileSystem: %s\n", temp));
|
||||
} else if (braced == 3) {
|
||||
/* SearchPaths */
|
||||
switch (token) {
|
||||
|
@ -379,7 +377,6 @@ games_check_gtxt(int id, string gamedirname)
|
|||
gamedirchain = strcat(gamedirchain, argv(1), " ");
|
||||
break;
|
||||
}
|
||||
print(sprintf("SearchPaths: %s\n", temp));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -398,7 +395,6 @@ games_check_gtxt(int id, string gamedirname)
|
|||
games[id].gamedir = strcat(games[id].gamedir, argv(i), ";");
|
||||
}
|
||||
}
|
||||
print(sprintf("Final GameDir: %s\n", games[id].gamedir));
|
||||
|
||||
fclose(fh);
|
||||
ret = 1;
|
||||
|
@ -611,16 +607,16 @@ games_init(void)
|
|||
games[id].steambg = 0;
|
||||
|
||||
if (games_check_manifest(id, gamedirname) == 1) {
|
||||
print(sprintf("[MENU] Found manifest for %s\n", gamedirname));
|
||||
dprint(sprintf("[MENU] Found manifest for %s\n", gamedirname));
|
||||
games[id].info_type = GAMEINFO_MANIFEST;
|
||||
} else if (games_check_gtxt(id, gamedirname) == 1) {
|
||||
print(sprintf("[MENU] Found gameinfo for %s\n", gamedirname));
|
||||
dprint(sprintf("[MENU] Found gameinfo for %s\n", gamedirname));
|
||||
games[id].info_type = GAMEINFO_GITXT;
|
||||
} else if (games_check_liblist(id, gamedirname) == 1) {
|
||||
print(sprintf("[MENU] Found liblist for %s\n", gamedirname));
|
||||
dprint(sprintf("[MENU] Found liblist for %s\n", gamedirname));
|
||||
games[id].info_type = GAMEINFO_LIBLIST;
|
||||
} else {
|
||||
print(sprintf("[MENU] Found nothing for %s\n", gamedirname));
|
||||
dprint(sprintf("[MENU] Found nothing for %s\n", gamedirname));
|
||||
games[id].info_type = GAMEINFO_NONE;
|
||||
}
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ ChatLoadFile(string filename)
|
|||
c = tokenizebyseparator(g_table[i].sample, ";");
|
||||
for (int x = 0; x < c; x++) {
|
||||
precache_sound(argv(x));
|
||||
print(sprintf("[CHATSOUNDS] Caching: %s\n", argv(x)));
|
||||
dprint(sprintf("[CHATSOUNDS] Caching: %s\n", argv(x)));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue