1
This commit is contained in:
parent
963031c2e1
commit
c98ecd1a2e
@ -173,6 +173,18 @@ void Obstacle::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_d
|
||||
p->set_door_height(door_state1_->height());
|
||||
}
|
||||
}
|
||||
if (meta->i->thing_type() == kObstacleHideHouse) {
|
||||
ObstacleData* data = room->GetPermanentObstacleData(GetUniId());
|
||||
if (!a8::HasBitFlag(data->flags, kHealth)) {
|
||||
data->health = health_;
|
||||
a8::SetBitFlag(data->flags, kHealth);
|
||||
}
|
||||
if (GetInteractionData(hum)) {
|
||||
p->set_button_name("躲藏");
|
||||
} else {
|
||||
p->set_button_name("脱离");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Obstacle::GetAabbBox(AabbCollider& aabb_box)
|
||||
@ -638,9 +650,10 @@ void Obstacle::DoHideHouseInteraction(Human* sender)
|
||||
{
|
||||
auto p = GetInteractionData(sender);
|
||||
if (p) {
|
||||
sender->SetPos(std::get<1>(*p));
|
||||
ClearObstacleBuff(sender);
|
||||
sender->SetPos(std::get<1>(*p));
|
||||
} else {
|
||||
a8::Vec2 old_pos = sender->GetPos();
|
||||
sender->SetPos(GetPos());
|
||||
AddObstacleBuff(sender);
|
||||
ObstacleData* p = sender->room->GetPermanentObstacleData(GetUniId());
|
||||
@ -652,8 +665,9 @@ void Obstacle::DoHideHouseInteraction(Human* sender)
|
||||
p->interaction_humans = new std::map<int, std::tuple<long long, a8::Vec2>>();
|
||||
}
|
||||
(*p->interaction_humans)[sender->GetUniId()] = std::make_tuple
|
||||
(sender->room->GetFrameNo(), sender->GetPos());
|
||||
(sender->room->GetFrameNo(), old_pos);
|
||||
}
|
||||
sender->AddToNewObjects(this);
|
||||
}
|
||||
|
||||
std::tuple<long long, a8::Vec2>* Obstacle::GetInteractionData(Human* sender)
|
||||
|
@ -284,7 +284,7 @@ message MFObstacleFull
|
||||
optional float door_width = 27; //门宽度
|
||||
optional float door_height = 28; //门高度
|
||||
optional int32 door_open_times = 29; //门开启次数,每次开/关 ++times 0:客户端自动开
|
||||
|
||||
optional string button_name = 30; //按钮名(不为空是显示按钮,靠近时显示)
|
||||
}
|
||||
|
||||
//建筑物-部分
|
||||
|
Loading…
x
Reference in New Issue
Block a user