Replace any Hide() with calls to Disappear(), as that one will actually set the collision to no longer be solid.

This commit is contained in:
Marco Cawthorne 2022-08-30 16:02:56 -07:00
parent 522e45b1ee
commit be16666be8
Signed by: eukara
GPG key ID: CE2032F0A2882A22
10 changed files with 26 additions and 66 deletions

View file

@ -38,9 +38,8 @@ item_ammo::Touch(entity eToucher)
if (real_owner || cvar("sv_playerslots") == 1) { if (real_owner || cvar("sv_playerslots") == 1) {
Destroy(); Destroy();
} else { } else {
Hide(); Disappear();
think = Respawn; ScheduleThink(Respawn, 30.0f);
nextthink = time + 20.0f;
} }
} }
@ -53,8 +52,7 @@ item_ammo::Respawn(void)
SetModel(GetSpawnModel()); SetModel(GetSpawnModel());
SetSize([-16,-16,0],[16,16,16]); SetSize([-16,-16,0],[16,16,16]);
think = __NULL__; ReleaseThink();
nextthink = -1;
if (real_owner && time > 30.0f) if (real_owner && time > 30.0f)
Sound_Play(this, CHAN_ITEM, "ammo.respawn"); Sound_Play(this, CHAN_ITEM, "ammo.respawn");

View file

@ -67,9 +67,8 @@ void item_battery::Touch(entity eToucher)
if (real_owner || cvar("sv_playerslots") == 1) { if (real_owner || cvar("sv_playerslots") == 1) {
Destroy(); Destroy();
} else { } else {
Hide(); Disappear();
think = Respawn; ScheduleThink(Respawn, 30.0f);
nextthink = time + 20.0f;
} }
} }
@ -82,8 +81,7 @@ void item_battery::Respawn(void)
SetSize([-16,-16,0],[16,16,16]); SetSize([-16,-16,0],[16,16,16]);
botinfo = BOTINFO_ARMOR; botinfo = BOTINFO_ARMOR;
think = __NULL__; ReleaseThink();
nextthink = -1;
if (!real_owner && time > 30.0f) if (!real_owner && time > 30.0f)
Sound_Play(this, CHAN_ITEM, "item.respawn"); Sound_Play(this, CHAN_ITEM, "item.respawn");

View file

@ -50,9 +50,8 @@ void item_healthkit::Touch(entity eToucher)
if (real_owner || cvar("sv_playerslots") == 1) { if (real_owner || cvar("sv_playerslots") == 1) {
Destroy(); Destroy();
} else { } else {
Hide(); Disappear();
think = Respawn; ScheduleThink(Respawn, 30.0f);
nextthink = time + 20.0f;
} }
} }
@ -65,8 +64,7 @@ void item_healthkit::Respawn(void)
SetSize([-16,-16,0],[16,16,16]); SetSize([-16,-16,0],[16,16,16]);
botinfo = BOTINFO_HEALTH; botinfo = BOTINFO_HEALTH;
think = __NULL__; ReleaseThink();
nextthink = -1;
if (!real_owner && time > 30.0f) if (!real_owner && time > 30.0f)
Sound_Play(this, CHAN_ITEM, "item.respawn"); Sound_Play(this, CHAN_ITEM, "item.respawn");

View file

@ -59,11 +59,10 @@ item_longjump::Touch(entity eToucher)
} }
if (real_owner || cvar("sv_playerslots") == 1) { if (real_owner || cvar("sv_playerslots") == 1) {
remove(self); Destroy();
} else { } else {
Hide(); Disappear();
think = Respawn; ScheduleThink(Respawn, 30.0f);
nextthink = time + 30.0f;
} }
} }
@ -76,8 +75,7 @@ item_longjump::Respawn(void)
SetModel(GetSpawnModel()); SetModel(GetSpawnModel());
SetSize([-16,-16,0],[16,16,16]); SetSize([-16,-16,0],[16,16,16]);
think = __NULL__; ReleaseThink();
nextthink = -1;
if (!real_owner && time > 30.0f) if (!real_owner && time > 30.0f)
Sound_Play(this, CHAN_ITEM, "item.respawn"); Sound_Play(this, CHAN_ITEM, "item.respawn");

View file

@ -62,11 +62,10 @@ item_suit::Touch(entity eToucher)
} }
if (real_owner || cvar("sv_playerslots") == 1) { if (real_owner || cvar("sv_playerslots") == 1) {
remove(self); Destroy();
} else { } else {
Hide(); Disappear();
think = Respawn; ScheduleThink(Respawn, 30.0f);
nextthink = time + 30.0f;
} }
} }
@ -80,8 +79,7 @@ item_suit::Respawn(void)
SetSize(VEC_HULL_MIN + [0,0,36], VEC_HULL_MAX + [0,0,36]); SetSize(VEC_HULL_MIN + [0,0,36], VEC_HULL_MAX + [0,0,36]);
m_iValue = FALSE; m_iValue = FALSE;
think = __NULL__; ReleaseThink();
nextthink = -1;
if (!real_owner && time > 30.0f) if (!real_owner && time > 30.0f)
Sound_Play(this, CHAN_ITEM, "item.respawn"); Sound_Play(this, CHAN_ITEM, "item.respawn");

View file

@ -31,11 +31,10 @@ void item_pickup::Touch(entity eToucher)
UseTargets(eToucher, TRIG_TOGGLE, m_flDelay); UseTargets(eToucher, TRIG_TOGGLE, m_flDelay);
if (real_owner || m_iWasDropped == 1 || cvar("sv_playerslots") == 1) { if (real_owner || m_iWasDropped == 1 || cvar("sv_playerslots") == 1) {
remove(self); Destroy();
} else { } else {
Hide(); Disappear();
think = Respawn; ScheduleThink(Respawn, 30.0f);
nextthink = time + 30.0f;
} }
} }
@ -64,9 +63,7 @@ void item_pickup::Respawn(void)
} }
SetSize([-16,-16,0], [16,16,16]); SetSize([-16,-16,0], [16,16,16]);
ReleaseThink();
think = __NULL__;
nextthink = -1;
if (!m_iWasDropped && cvar("sv_playerslots") > 1) { if (!m_iWasDropped && cvar("sv_playerslots") > 1) {
if (!real_owner && time > 30.0f) if (!real_owner && time > 30.0f)
@ -76,7 +73,7 @@ void item_pickup::Respawn(void)
} }
if (!m_bFloating) { if (!m_bFloating) {
droptofloor(); DropToFloor();
SetMovetype(MOVETYPE_TOSS); SetMovetype(MOVETYPE_TOSS);
} }
} }

View file

@ -27,7 +27,6 @@ class monster_hevsuit_dead:NSMonster
int m_iPose; int m_iPose;
void(void) monster_hevsuit_dead; void(void) monster_hevsuit_dead;
virtual void(void) Hide;
virtual void(void) Respawn; virtual void(void) Respawn;
virtual void(void) Gib; virtual void(void) Gib;
virtual void(string, string) SpawnKey; virtual void(string, string) SpawnKey;
@ -38,15 +37,7 @@ monster_hevsuit_dead::Gib(void)
{ {
takedamage = DAMAGE_NO; takedamage = DAMAGE_NO;
FX_GibHuman(origin, vectoangles(origin - g_dmg_eAttacker.origin), g_dmg_iDamage * 2.0f); FX_GibHuman(origin, vectoangles(origin - g_dmg_eAttacker.origin), g_dmg_iDamage * 2.0f);
Hide(); Disappear();
}
void
monster_hevsuit_dead::Hide(void)
{
SetModel("");
solid = SOLID_NOT;
movetype = MOVETYPE_NONE;
} }
void void

View file

@ -27,7 +27,6 @@ class monster_hgrunt_dead:NSMonster
int m_iPose; int m_iPose;
void(void) monster_hgrunt_dead; void(void) monster_hgrunt_dead;
virtual void(void) Hide;
virtual void(void) Respawn; virtual void(void) Respawn;
virtual void(void) Gib; virtual void(void) Gib;
virtual void(string, string) SpawnKey; virtual void(string, string) SpawnKey;
@ -38,15 +37,7 @@ monster_hgrunt_dead::Gib(void)
{ {
takedamage = DAMAGE_NO; takedamage = DAMAGE_NO;
FX_GibHuman(origin, vectoangles(origin - g_dmg_eAttacker.origin), g_dmg_iDamage * 2.0f); FX_GibHuman(origin, vectoangles(origin - g_dmg_eAttacker.origin), g_dmg_iDamage * 2.0f);
Hide(); Disappear();
}
void
monster_hgrunt_dead::Hide(void)
{
SetModel("");
solid = SOLID_NOT;
movetype = MOVETYPE_NONE;
} }
void void

View file

@ -38,7 +38,6 @@ class monster_scientist_dead:NSMonster
int m_iPose; int m_iPose;
void(void) monster_scientist_dead; void(void) monster_scientist_dead;
virtual void(void) Hide;
virtual void(void) Respawn; virtual void(void) Respawn;
virtual void(void) Gib; virtual void(void) Gib;
virtual void(string, string) SpawnKey; virtual void(string, string) SpawnKey;
@ -49,15 +48,7 @@ monster_scientist_dead::Gib(void)
{ {
takedamage = DAMAGE_NO; takedamage = DAMAGE_NO;
FX_GibHuman(origin, vectoangles(origin - g_dmg_eAttacker.origin), g_dmg_iDamage * 2.0f); FX_GibHuman(origin, vectoangles(origin - g_dmg_eAttacker.origin), g_dmg_iDamage * 2.0f);
Hide(); Disappear();
}
void
monster_scientist_dead::Hide(void)
{
SetModel("");
solid = SOLID_NOT;
movetype = MOVETYPE_NONE;
} }
void void

View file

@ -49,7 +49,7 @@ monster_sitting_scientist::Gib(void)
{ {
SetTakedamage(DAMAGE_NO); SetTakedamage(DAMAGE_NO);
FX_GibHuman(GetOrigin(), vectoangles(GetOrigin() - g_dmg_eAttacker.origin), g_dmg_iDamage * 2.0f); FX_GibHuman(GetOrigin(), vectoangles(GetOrigin() - g_dmg_eAttacker.origin), g_dmg_iDamage * 2.0f);
Hide(); Disappear();
} }
void void