Monster spawning position and scripted sequence fixes. Also leave movetype of LEAVECORPSE scripted sequence entities alone or else it breaks of1a1's G-Man
This commit is contained in:
parent
5f7ea594b8
commit
4f699aae6e
9 changed files with 12 additions and 16 deletions
|
@ -273,7 +273,7 @@ scripted_sequence::RunOnEntity(entity targ)
|
|||
NSLog("\tType: SS_RUN (%i)", m_iMove);
|
||||
return;
|
||||
} else if (m_iMove == SS_INSTANTANEOUS) {
|
||||
setorigin(f, this.origin);
|
||||
f.SetOrigin(GetOrigin());
|
||||
f.DropToFloor();
|
||||
NSLog("\tType: SS_INSTANTANEOUS (%i)", m_iMove);
|
||||
} else if (m_iMove == SS_TURNTOFACE) {
|
||||
|
|
|
@ -182,8 +182,6 @@ void NSEntity::ReceiveEntity( float flNew, float flChanged ) {
|
|||
|
||||
if ( flChanged & BASEFL_CHANGED_SIZE )
|
||||
setsize( this, mins, maxs );
|
||||
|
||||
setorigin( this, origin );
|
||||
}
|
||||
|
||||
void NSEntity::postdraw( void ) {
|
||||
|
|
|
@ -1188,7 +1188,6 @@ NSMonster::FreeStateDead(void)
|
|||
DropToFloor();
|
||||
|
||||
RemoveFlags(FL_MONSTER);
|
||||
SetMovetype(MOVETYPE_NONE);
|
||||
SetSolid(SOLID_CORPSE);
|
||||
SetState(MONSTER_DEAD);
|
||||
FreeState();
|
||||
|
@ -1678,6 +1677,14 @@ NSMonster::Hide(void)
|
|||
void
|
||||
NSMonster::Respawn(void)
|
||||
{
|
||||
/* we need to delay the DropToFloor() by at least a frame.
|
||||
otherwise they may just fall through an entity (func_wall, func_train etc.)
|
||||
that came after this entity in the lump. */
|
||||
static void AdjustSpawnPos(void) {
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
DropToFloor();
|
||||
}
|
||||
|
||||
v_angle = GetSpawnAngles();
|
||||
v_angle[0] = Math_FixDelta(v_angle[0]);
|
||||
v_angle[1] = Math_FixDelta(v_angle[1]);
|
||||
|
@ -1698,11 +1705,9 @@ NSMonster::Respawn(void)
|
|||
SetMovetype(MOVETYPE_WALK);
|
||||
SetModel(GetSpawnModel());
|
||||
SetSize(base_mins, base_maxs);
|
||||
//SetOrigin();
|
||||
setorigin_safe(this, GetSpawnOrigin());
|
||||
SetEyePos([0, 0, m_flEyeHeight]);
|
||||
ScheduleThink(AdjustSpawnPos, 0.0f);
|
||||
|
||||
DropToFloor();
|
||||
|
||||
if (m_bWeaponStartsDrawn) {
|
||||
m_bWeaponDrawn = true;
|
||||
|
|
|
@ -297,7 +297,6 @@ NSPhysicsEntity::ReceiveEntity(float flNew, float flChanged)
|
|||
if (flChanged & RDENT_CHANGED_BODY)
|
||||
_UpdateGeomset();
|
||||
|
||||
setorigin(this, origin);
|
||||
movetype = MOVETYPE_NONE;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -440,7 +440,7 @@ NSPortal::ReceiveEntity(float flNew, float flChanged)
|
|||
m_vecTargetS = v_right;
|
||||
m_vecTargetT = v_up;
|
||||
}
|
||||
setorigin(this, origin);
|
||||
|
||||
_PortalUpdated();
|
||||
drawmask = MASK_ENGINE;
|
||||
predraw = 0;
|
||||
|
|
|
@ -836,7 +836,6 @@ NSProjectile::ReceiveEntity(float flNew, float flChanged)
|
|||
READENTITY_COLOR(m_vecRenderColor[2], PROJ_CHANGED_RENDERCOLOR)
|
||||
READENTITY_COLOR(m_flRenderAmt, PROJ_CHANGED_RENDERAMT)
|
||||
setmodelindex(this, modelindex);
|
||||
setorigin(this, origin);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -298,8 +298,6 @@ NSRenderableEntity::ReceiveEntity(float flNew, float flChanged)
|
|||
setsize(this, mins * scale, maxs * scale);
|
||||
if (flChanged & RDENT_CHANGED_BODY)
|
||||
_UpdateGeomset();
|
||||
|
||||
setorigin(this, origin);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -384,8 +384,6 @@ NSSurfacePropEntity::ReceiveEntity(float flNew, float flChanged)
|
|||
setsize(this, mins * scale, maxs * scale);
|
||||
if (flChanged & SRFENT_CHANGED_BODY)
|
||||
setcustomskin(this, "", sprintf("geomset 0 %i\ngeomset 1 %i\n", m_iBody, m_iBody));
|
||||
|
||||
setorigin(this, origin);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -643,6 +643,7 @@ void
|
|||
NSTalkMonster::Respawn(void)
|
||||
{
|
||||
super::Respawn();
|
||||
|
||||
m_eFollowing = world;
|
||||
m_eFollowingChain = world;
|
||||
PlayerUse = OnPlayerUse;
|
||||
|
@ -1026,8 +1027,6 @@ NSTalkMonster::ReceiveEntity(float flNew, float flChanged)
|
|||
setsize(this, mins * scale, maxs * scale);
|
||||
if (flChanged & MONFL_CHANGED_BODY)
|
||||
_UpdateGeomset();
|
||||
|
||||
setorigin(this, origin);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue