From 3c108eadad8bdd3389467301301a4eb1a2d7f9c9 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 25 Jun 2021 20:47:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B1=BD=E6=B2=B9=E6=A1=B6=E6=89=93=E7=88=86?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E6=B2=A1=E6=9C=89=E5=8F=AC=E5=94=A4=E7=87=83?= =?UTF-8?q?=E7=83=A7=E5=BC=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/gameserver/obstacle.cc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/server/gameserver/obstacle.cc b/server/gameserver/obstacle.cc index da739ba..d730135 100644 --- a/server/gameserver/obstacle.cc +++ b/server/gameserver/obstacle.cc @@ -513,6 +513,17 @@ void Obstacle::OnBulletHit(Bullet* bullet) if (IsDead(bullet->room)) { ProcDieExplosion(bullet->room); bullet->sender.Get()->DropItems(this); + if (meta->i->thing_type() == kObstacleOilBucket) { + MetaData::MapThing* bomb_meta = MetaMgr::Instance()->GetMapThing(meta->int_param1); + if (bomb_meta) { + RoomObstacle* obstacle = bullet->room->CreateObstacle + ( + bomb_meta->i->thing_id(), + GetPos().x, + GetPos().y + ); + } + } } BroadcastFullState(bullet->room); #ifdef DEBUG @@ -556,6 +567,17 @@ void Obstacle::OnExplosionHit(Explosion* e) if (meta->i->drop() != 0) { e->GetRoom()->ScatterDrop(GetPos(), meta->i->drop()); } + if (meta->i->thing_type() == kObstacleOilBucket) { + MetaData::MapThing* bomb_meta = MetaMgr::Instance()->GetMapThing(meta->int_param1); + if (bomb_meta) { + RoomObstacle* obstacle = e->GetRoom()->CreateObstacle + ( + bomb_meta->i->thing_id(), + GetPos().x, + GetPos().y + ); + } + } } BroadcastFullState(e->GetRoom()); }