CEntity and friends

This commit is contained in:
aap 2020-05-19 20:56:42 +02:00
parent 8a90e32f1b
commit bdbe5d1080
26 changed files with 581 additions and 650 deletions

View file

@ -14,7 +14,8 @@
#include "soundlist.h"
int16 CObject::nNoTempObjects;
int16 CObject::nBodyCastHealth = 1000;
//int16 CObject::nBodyCastHealth = 1000;
float CObject::fDistToNearestTree;
void *CObject::operator new(size_t sz) { return CPools::GetObjectPool()->New(); }
void *CObject::operator new(size_t sz, int handle) { return CPools::GetObjectPool()->New(handle);};
@ -161,6 +162,7 @@ CObject::ObjectDamage(float amount)
return;
static int8 nFrameGen = 0;
bool bBodyCastDamageEffect = false;
#if 0
if (GetModelIndex() == MI_BODYCAST) {
if (amount > 50.0f)
nBodyCastHealth = (int16)(nBodyCastHealth - 0.5f * amount);
@ -170,6 +172,7 @@ CObject::ObjectDamage(float amount)
bBodyCastDamageEffect = true;
amount = 0.0f;
}
#endif
if ((amount * m_fCollisionDamageMultiplier > 150.0f || bBodyCastDamageEffect) && m_nCollisionDamageEffect) {
const CVector& vecPos = m_matrix.GetPosition();
const float fDirectionZ = 0.0002f * amount;
@ -335,9 +338,12 @@ CObject::Init(void)
m_pCurSurface = outEntity;
else
m_pCurSurface = nil;
#if 0
if (GetModelIndex() == MI_BODYCAST)
nBodyCastHealth = 1000;
else if (GetModelIndex() == MI_BUOY)
else
#endif
if (GetModelIndex() == MI_BUOY)
bTouchingWater = true;
}