diff --git a/server/gameserver/car.cc b/server/gameserver/car.cc index 9730630..5cdb00d 100644 --- a/server/gameserver/car.cc +++ b/server/gameserver/car.cc @@ -149,6 +149,7 @@ void Car::GetOn(Human* passenger) driver_ = passenger; driver_->SetAttackDir(a8::Vec2::RIGHT); SetAttackDir(driver_->GetAttackDir()); + room->TakeOnCarObject(GetEntityUniId()); } passenger->SetCar(this); passenger->SetSeat(seat); @@ -170,6 +171,7 @@ void Car::GetOn(Human* passenger) TryAddBuff(this, meta->car_active_buff_id); } SyncAroundPlayers(__FILE__, __LINE__, __func__); + room->NotifyUiUpdate(); } void Car::SwitchSeat(Human* passenger, int seat) @@ -310,6 +312,7 @@ void Car::DecHP(float dec_hp, int killer_id, const std::string& killer_name, int void Car::BeKill(int killer_id, const std::string& killer_name, int weapon_id) { dead = true; + room->TakeOnCarObject(GetEntityUniId()); BroadcastDeleteState(room); RemoveFromAroundPlayers(room); room->grid_service->RemoveCreature(this); diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 689e9fa..58509a8 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -3383,8 +3383,6 @@ void Human::DoGetOnWithLoot(Loot* entity) team_id ); car->GetOn(this); - room->TakeOnCarObject(entity->GetEntityUniId()); - room->NotifyUiUpdate(); #ifdef DEBUG a8::XPrintf("DoGetOnWithLoot uniid:%d car_uniid:%d\n", {car->GetEntityUniId(), car->car_uniid}); #endif diff --git a/server/gameserver/metamgr.cc b/server/gameserver/metamgr.cc index c32528b..2828fe9 100755 --- a/server/gameserver/metamgr.cc +++ b/server/gameserver/metamgr.cc @@ -520,6 +520,9 @@ private: MetaData::Buff& item = a8::FastAppend(buff_list); item.i = &meta; item.Init(); + if (buff_hash.find(item.i->buff_id()) != buff_hash.end()) { + abort(); + } buff_hash[item.i->buff_id()] = &item; }