From 05f6af510a950eb3a7024d4c2f200cd86c0dd0c4 Mon Sep 17 00:00:00 2001 From: Marco Hladik Date: Sun, 10 Apr 2022 07:21:25 -0700 Subject: [PATCH] NSSurfacePropEntity: put rendering for when an entity is burning into the new method RenderFire(). Also some minor non-ODE physics tweak. --- src/client/player.qc | 2 ++ src/gs-entbase/server/NSPhysicsEntity.qc | 7 +++++-- src/gs-entbase/shared/NSSurfacePropEntity.h | 1 + src/gs-entbase/shared/NSSurfacePropEntity.qc | 9 +++++++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/client/player.qc b/src/client/player.qc index 00a3a9c9..a1e7131c 100644 --- a/src/client/player.qc +++ b/src/client/player.qc @@ -48,6 +48,8 @@ player::predraw(void) effects &= ~EF_NOSHADOW; base_client cl = (base_client)pSeat->m_ePlayer; + RenderFire(); + /* it's either us or us spectating */ if (Client_IsSpectator(cl)) { spectator spec = (spectator)pSeat->m_ePlayer; diff --git a/src/gs-entbase/server/NSPhysicsEntity.qc b/src/gs-entbase/server/NSPhysicsEntity.qc index 20a6cae1..83384a7e 100644 --- a/src/gs-entbase/server/NSPhysicsEntity.qc +++ b/src/gs-entbase/server/NSPhysicsEntity.qc @@ -16,6 +16,7 @@ #define ODE_MODE 1 +/* all the documented phys vars...*/ .float geomtype; .float friction; .float erp; @@ -45,8 +46,8 @@ NSPhysicsEntity::PhysicsDisable(void) physics_enable(this, FALSE); SetMovetype(MOVETYPE_NONE); } else { - SetMovetype(MOVETYPE_BOUNCE); - SetSolid(SOLID_CORPSE); + SetMovetype(MOVETYPE_NONE); + SetSolid(SOLID_BBOX); } m_iEnabled = FALSE; } @@ -164,6 +165,8 @@ NSPhysicsEntity::ApplyTorqueCenter(vector vecTorque) void NSPhysicsEntity::TouchThink(void) { + if (!m_iEnabled) + return; if (physics_supported() == FALSE) { /* let players collide */ diff --git a/src/gs-entbase/shared/NSSurfacePropEntity.h b/src/gs-entbase/shared/NSSurfacePropEntity.h index 43ba3cc5..055283b7 100644 --- a/src/gs-entbase/shared/NSSurfacePropEntity.h +++ b/src/gs-entbase/shared/NSSurfacePropEntity.h @@ -31,6 +31,7 @@ class NSSurfacePropEntity:NSRenderableEntity virtual void(void) ParentUpdate; #else virtual float(void) predraw; + virtual void(void) RenderFire; #endif /* new */ diff --git a/src/gs-entbase/shared/NSSurfacePropEntity.qc b/src/gs-entbase/shared/NSSurfacePropEntity.qc index fc8c1a6b..1984b5f3 100644 --- a/src/gs-entbase/shared/NSSurfacePropEntity.qc +++ b/src/gs-entbase/shared/NSSurfacePropEntity.qc @@ -307,8 +307,8 @@ NSSurfacePropEntity::PropDataFinish(void) m_iPropData = -1; } #else -float -NSSurfacePropEntity::predraw(void) +void +NSSurfacePropEntity::RenderFire(void) { if (flags & FL_ONFIRE) { vector someorg; @@ -321,6 +321,11 @@ NSSurfacePropEntity::predraw(void) m_flBurnNext = time + 0.1f; } } +} +float +NSSurfacePropEntity::predraw(void) +{ + RenderFire(); return super::predraw(); } #endif