This commit is contained in:
aozhiwei 2023-04-03 10:08:51 +08:00
parent dbb53b64bc
commit 1ba97eabe0
4 changed files with 4 additions and 0 deletions

View File

@ -294,6 +294,7 @@ bool Obstacle::DoInteraction(Human* sender)
default:
{
if (!IsDead(sender->room) && IsOpenInteraction()) {
dead_reason = 1;
Die(sender->room);
sender->DropItems(this);
BroadcastFullState(sender->room);

View File

@ -15,6 +15,7 @@ class Obstacle : public Entity
MapService* permanent_map_service = nullptr;
bool is_permanent = false;
float scale = 1.0f;
int dead_reason = 0;
virtual ~Obstacle() override;
virtual void Initialize() override;

View File

@ -451,6 +451,7 @@ void Obstacle::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_d
p->set_health(GetHealth(room));
p->set_dead(IsDead(room));
p->set_dead_at_thisframe(IsDead(room) ? GetDeadFrameNo(room) <= room->GetFrameNo() : false);
p->set_dead_reason(dead_reason);
if (!IsPermanent()) {
RoomObstacle* ob = (RoomObstacle*)this;

View File

@ -359,6 +359,7 @@ message MFObstacleFull
optional float health = 7; //
optional bool dead = 8; //
optional bool dead_at_thisframe = 9; //()
optional int32 dead_reason = 42 [default = 0]; // 0: 1:
optional bool is_door = 20; //
//is_door==ture时以下字段才有意义