NSItem: Position entity after everything else has spawned, to avoid entity lump ordering messing with droptofloor() calls
This commit is contained in:
parent
038265dd64
commit
4790e9d230
1 changed files with 14 additions and 6 deletions
|
@ -39,6 +39,19 @@ NSItem::Spawned(void)
|
||||||
void
|
void
|
||||||
NSItem::Respawn(void)
|
NSItem::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) {
|
||||||
|
RestoreAngles();
|
||||||
|
SetOrigin(GetSpawnOrigin());
|
||||||
|
|
||||||
|
if (!m_bFloating) {
|
||||||
|
DropToFloor();
|
||||||
|
SetMovetype(MOVETYPE_TOSS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SetSolid(SOLID_TRIGGER);
|
SetSolid(SOLID_TRIGGER);
|
||||||
SetOrigin(GetSpawnOrigin());
|
SetOrigin(GetSpawnOrigin());
|
||||||
botinfo = BOTINFO_WEAPON;
|
botinfo = BOTINFO_WEAPON;
|
||||||
|
@ -54,12 +67,7 @@ NSItem::Respawn(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
SetSize([-16,-16,0], [16,16,16]);
|
SetSize([-16,-16,0], [16,16,16]);
|
||||||
ReleaseThink();
|
ScheduleThink(AdjustSpawnPos, 0.0f);
|
||||||
|
|
||||||
if (!m_bFloating) {
|
|
||||||
DropToFloor();
|
|
||||||
SetMovetype(MOVETYPE_TOSS);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue