This commit is contained in:
aozhiwei 2021-05-06 19:47:29 +08:00
parent 8d7d8dbb0d
commit 09b43289aa
3 changed files with 7 additions and 1 deletions

View File

@ -17,6 +17,7 @@ class Car : public Creature
public: public:
int car_uniid = 0; int car_uniid = 0;
MetaData::Equip* meta = nullptr; MetaData::Equip* meta = nullptr;
MetaData::Player* hero_meta_ = nullptr;
Car(); Car();
virtual ~Car() override; virtual ~Car() override;
@ -38,5 +39,4 @@ class Car : public Creature
bool later_removed_ = false; bool later_removed_ = false;
Human* driver_ = nullptr; Human* driver_ = nullptr;
std::set<Human*> passengers_; std::set<Human*> passengers_;
MetaData::Player* hero_meta_ = nullptr;
}; };

View File

@ -149,6 +149,9 @@ void Player::UpdateMove()
if (HasBuffEffect(kBET_Vertigo)) { if (HasBuffEffect(kBET_Vertigo)) {
return; return;
} }
if (GetCar() && GetCar()->HasBuffEffect(kBET_Vertigo)) {
return;
}
if (HasBuffEffect(kBET_Passenger)) { if (HasBuffEffect(kBET_Passenger)) {
return; return;
} }

View File

@ -593,6 +593,9 @@ Car* Room::CreateCar(Human* driver,
AddToEntityHash(car); AddToEntityHash(car);
grid_service->AddCreature(car); grid_service->AddCreature(car);
car->RefreshView(); car->RefreshView();
for (int buff_id : car->hero_meta_->init_buffs) {
car->MustBeAddBuff(car, buff_id);
}
car->BroadcastFullState(this); car->BroadcastFullState(this);
return car; return car;
} }