Commit 8063bfac authored by Alexey Hohlov's avatar Alexey Hohlov
Browse files

Больше проверок для снарядов, мелкие оптимизации.

parent 66340775
......@@ -10,7 +10,6 @@ CProjectileBullet::CProjectileBullet(CVector p)
TextureManager& TexManager = TextureManager::GetInstance();
_type = "CProjectile";
solid = false;
p.z = 5;
pos(p);
_speed = 15;
......@@ -26,20 +25,23 @@ CProjectileBullet::CProjectileBullet(CVector p)
void CProjectileBullet::collide(IObjectStatic * coll)
{
if (_destroyed) return;
if (!coll->solid) return;
if (coll->flat) return;
if (coll->gettype() == "CVehicle" && ((TTank*)coll)->pid() == player_id)
{
return;
if (coll->getBaseClassName() == "IBaseVehicle") {
/* skip self */
if (((IBaseVehicle*)coll)->pid() == player_id) {
return;
}
}
coll->damage(arm_dmg, expl_dmg, 0.0f);
// IObjectStatic* fabric.CreateDynamic();
/* CFabric& fabric = CFabric::GetFabric();
TExplo* explosion;
explosion = (TExplo*)fabric.CreateDynamic("TExplo", _pos);*/
{
CFabric& fabric = CFabric::GetFabric();
fabric.CreateDynamic("TExplo", _pos);
}
// explosion = new TExplo(_pos,16,1);
destroy();
}
......@@ -48,11 +50,6 @@ void CProjectileBullet::step()
}
unsigned char CProjectileBullet::pid()
{
return player_id;
}
bool CProjectileBullet::draw()
{
return false;
......
......@@ -13,7 +13,6 @@ CProjectileFire::CProjectileFire(CVector p)
string str;
this->_type = "CProjectile";
this->solid = false;
this->_pos = p;
this->_pos.z = 5;
this->_speed = 5;
......
......@@ -15,8 +15,6 @@ public:
bool draw(void);
uint8_t pid(void);
std::string getClassName(void) { return "CProjectileBullet"; }
IObjectBase* clone(void) { return new CProjectileBullet(); }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment