Use GetSpawnX() methods instead of peeking into some attribute that

may change.
This commit is contained in:
Marco Cawthorne 2021-09-16 18:39:13 +02:00
parent 93bb3e92fe
commit 0334773293
Signed by: eukara
GPG Key ID: C196CD8BA993248A
7 changed files with 19 additions and 19 deletions

View File

@ -49,8 +49,8 @@ item_ammo::Respawn(void)
SetSolid(SOLID_TRIGGER);
SetMovetype(MOVETYPE_TOSS);
SetSize([-16,-16,0],[16,16,16]);
SetOrigin(m_oldOrigin);
SetModel(m_oldModel);
SetOrigin(GetSpawnOrigin());
SetModel(GetSpawnModel());
think = __NULL__;
nextthink = -1;
@ -64,8 +64,8 @@ item_ammo::Respawn(void)
void
item_ammo::item_ammo(void)
{
m_oldModel = model;
SetModel(m_oldModel);
GetSpawnModel() = model;
SetModel(GetSpawnModel());
CBaseEntity::CBaseEntity();
}

View File

@ -66,8 +66,8 @@ info_runespawn::Respawn(void)
* Rotation
* avelocity[1] = 420; */
/* Always spawns a little above origin */
SetOrigin(m_oldOrigin + [0,0,16]);
SetModel(m_oldModel);
SetOrigin(GetSpawnOrigin() + [0,0,16]);
SetModel(GetSpawnModel());
think = __NULL__;

View File

@ -74,8 +74,8 @@ item_battery::Respawn(void)
SetRenderAmt(255);
SetSize([-16,-16,0],[16,16,16]);
/* Always spawns a little above origin */
SetOrigin(m_oldOrigin + [0,0,16]);
SetModel(m_oldModel);
SetOrigin(GetSpawnOrigin() + [0,0,16]);
SetModel(GetSpawnModel());
think = __NULL__;
nextthink = -1;

View File

@ -62,8 +62,8 @@ item_healthkit::Respawn(void)
SetRenderAmt(255);
SetSize([-16,-16,0],[16,16,16]);
/* Always spawns a little above origin */
SetOrigin(m_oldOrigin + [0,0,16]);
SetModel(m_oldModel);
SetOrigin(GetSpawnOrigin() + [0,0,16]);
SetModel(GetSpawnModel());
think = __NULL__;
nextthink = -1;

View File

@ -73,8 +73,8 @@ item_rune_haste::Respawn(void)
SetSolid(SOLID_TRIGGER);
SetMovetype(MOVETYPE_NONE);
SetSize(VEC_HULL_MIN, VEC_HULL_MAX);
SetOrigin(m_oldOrigin);
SetModel(m_oldModel);
SetOrigin(GetSpawnOrigin());
SetModel(GetSpawnModel());
think = __NULL__;
nextthink = -1;

View File

@ -75,8 +75,8 @@ item_rune_stalker::Respawn(void)
SetSolid(SOLID_TRIGGER);
SetMovetype(MOVETYPE_TOSS);
SetSize(VEC_HULL_MIN, VEC_HULL_MAX);
SetOrigin(m_oldOrigin);
SetModel(m_oldModel);
SetOrigin(GetSpawnOrigin());
SetModel(GetSpawnModel());
think = __NULL__;
nextthink = -1;

View File

@ -49,8 +49,8 @@ void
item_pickup::SetItem(int i)
{
id = i;
m_oldModel = Weapons_GetWorldmodel(id);
SetModel(m_oldModel);
GetSpawnModel() = Weapons_GetWorldmodel(id);
SetModel(GetSpawnModel());
}
void
@ -63,11 +63,11 @@ 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) {
SetModel(m_oldModel);
if (GetSpawnModel()) {
SetModel(GetSpawnModel());
}
SetSize([-16,-16,0], [16,16,16]);