fix GetName

This commit is contained in:
aozhiwei 2021-09-06 09:09:12 +00:00
parent 94c1b2274d
commit 6d4ebdff10
4 changed files with 12 additions and 0 deletions

View File

@ -428,6 +428,11 @@ void Car::GetHitAabbBox(AabbCollider& aabb_box)
aabb_box.MoveCenter(hero_meta_->i->hit_offset_x(), hero_meta_->i->hit_offset_y());
}
std::string Car::GetName()
{
return hero_meta_->i->name();
}
void Car::SendDebugMsg(const std::string& debug_msg)
{
#if 1

View File

@ -29,6 +29,7 @@ class Car : public Creature
virtual void OnExplosionHit(Explosion* e) override;
virtual void GetAabbBox(AabbCollider& aabb_box) override;
virtual void GetHitAabbBox(AabbCollider& aabb_box) override;
virtual std::string GetName() override;
bool IsDriver(Human* hum) { return driver_ == hum && driver_; }
Human* GetPassengerBySeat(int seat);

View File

@ -375,3 +375,8 @@ void Hero::Destory()
},
&xtimer_attacher.timer_list_);
}
std::string Hero::GetName()
{
return meta->i->name();
}

View File

@ -30,6 +30,7 @@ public:
virtual void OnBulletHit(Bullet* bullet) override;
virtual void Update(int delta_time) override;
virtual void DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id) override;
virtual std::string GetName() override;
virtual float GetSpeed() override;
virtual float GetRadius() override;