This commit is contained in:
aozhiwei 2021-03-11 13:53:49 +08:00
parent e6f1defa54
commit e06af25b29
5 changed files with 20 additions and 5 deletions

View File

@ -99,6 +99,15 @@ namespace MetaData
return ""; return "";
} }
void MapThing::Init()
{
std::vector<std::string> strings;
a8::Split(i->buff_list(), strings, '|');
for (const std::string& tmp_str : strings) {
buff_list.push_back(a8::XValue(tmp_str));
}
}
void Equip::Init() void Equip::Init()
{ {
{ {

View File

@ -41,6 +41,9 @@ namespace MetaData
struct MapThing struct MapThing
{ {
const metatable::MapThing* i = nullptr; const metatable::MapThing* i = nullptr;
std::vector<int> buff_list;
void Init();
}; };
struct SafeArea struct SafeArea

View File

@ -508,6 +508,7 @@ private:
for (auto& meta : mapthing_meta_list) { for (auto& meta : mapthing_meta_list) {
MetaData::MapThing& item = a8::FastAppend(mapthing_list); MetaData::MapThing& item = a8::FastAppend(mapthing_list);
item.i = &meta; item.i = &meta;
item.Init();
mapthing_hash[item.i->thing_id()] = &item; mapthing_hash[item.i->thing_id()] = &item;
} }

View File

@ -131,7 +131,7 @@ void RoomObstacle::ActiveTimerFunc()
void RoomObstacle::UpdateTimerFunc() void RoomObstacle::UpdateTimerFunc()
{ {
if (grid_list_ && master) { if (grid_list_ && master && !IsDead(room)) {
std::set<Human*> human_list; std::set<Human*> human_list;
room->grid_service->TouchAllLayerHumanList room->grid_service->TouchAllLayerHumanList
(room->GetRoomIdx(), (room->GetRoomIdx(),
@ -143,11 +143,13 @@ void RoomObstacle::UpdateTimerFunc()
} }
} }
); );
for (Human* hum : human_list) {
}
if (!human_list.empty()) { if (!human_list.empty()) {
for (Human* hum : human_list) {
}
Explosion(); Explosion();
Die(room);
BroadcastFullState(room);
} }
} }
} }

View File

@ -50,7 +50,7 @@ message MapThing
optional int32 is_house = 11; // optional int32 is_house = 11; //
optional int32 is_tree = 12; // optional int32 is_tree = 12; //
optional int32 house_id = 13; //id optional int32 house_id = 13; //id
repeated int32 buff_list = 14; optional string buff_list = 14;
} }
message SafeArea message SafeArea