From 0334773293d47f6e0ebaf7a635c51ed2b4ba7c18 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Thu, 16 Sep 2021 18:39:13 +0200 Subject: [PATCH] Use GetSpawnX() methods instead of peeking into some attribute that may change. --- src/server/ammo_hd.qc | 8 ++++---- src/server/info_runespawn.qc | 4 ++-- src/server/item_battery.qc | 4 ++-- src/server/item_healthkit.qc | 4 ++-- src/server/item_rune_haste.qc | 4 ++-- src/server/item_rune_stalker.qc | 4 ++-- src/server/items.qc | 10 +++++----- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/server/ammo_hd.qc b/src/server/ammo_hd.qc index 8e2c6f5..105d992 100644 --- a/src/server/ammo_hd.qc +++ b/src/server/ammo_hd.qc @@ -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(); } diff --git a/src/server/info_runespawn.qc b/src/server/info_runespawn.qc index 9732c50..8939dc9 100644 --- a/src/server/info_runespawn.qc +++ b/src/server/info_runespawn.qc @@ -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__; diff --git a/src/server/item_battery.qc b/src/server/item_battery.qc index b507f06..f53d1e0 100644 --- a/src/server/item_battery.qc +++ b/src/server/item_battery.qc @@ -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; diff --git a/src/server/item_healthkit.qc b/src/server/item_healthkit.qc index a2e21da..2242086 100644 --- a/src/server/item_healthkit.qc +++ b/src/server/item_healthkit.qc @@ -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; diff --git a/src/server/item_rune_haste.qc b/src/server/item_rune_haste.qc index 699e590..a1c5b42 100644 --- a/src/server/item_rune_haste.qc +++ b/src/server/item_rune_haste.qc @@ -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; diff --git a/src/server/item_rune_stalker.qc b/src/server/item_rune_stalker.qc index 01b3503..e70137e 100644 --- a/src/server/item_rune_stalker.qc +++ b/src/server/item_rune_stalker.qc @@ -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; diff --git a/src/server/items.qc b/src/server/items.qc index 0a0e008..0e44bd5 100644 --- a/src/server/items.qc +++ b/src/server/items.qc @@ -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]);