This commit is contained in:
aozhiwei 2021-09-18 09:25:46 +00:00
parent c97f7ab12c
commit 4e07bbeae4
4 changed files with 11 additions and 0 deletions

View File

@ -1,5 +1,7 @@
#include "precompile.h"
#include <math.h>
#include "obstacle.h"
#include "metamgr.h"
#include "room.h"
@ -155,6 +157,11 @@ void Obstacle::FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_d
p->set_dead(IsDead(room));
p->set_dead_at_thisframe(IsDead(room) ? GetDeadFrameNo(room) <= room->GetFrameNo() : false);
if (!IsPermanent()) {
RoomObstacle* ob = (RoomObstacle*)this;
p->set_born_frameno(ceil(ob->born_frameno / 2.0));
}
p->set_is_door(is_door_);
if (is_door_ && IsPermanent()) {
ObstacleData* data = room->GetPermanentObstacleData(GetUniId());

View File

@ -58,6 +58,7 @@ void RoomObstacle::Initialize()
if (meta->sweep_tags != 0) {
room->mine_objects[GetUniId()] = GetWeakPtrRef();
}
born_frameno = room->GetFrameNo();
}
void RoomObstacle::RecalcSelfCollider()

View File

@ -22,6 +22,7 @@ class RoomObstacle : public Obstacle
std::shared_ptr<Ability> context_ability;
bool sweep_lock = false;
MetaData::Buff* buff_meta = nullptr;
long long born_frameno = 0;
virtual ~RoomObstacle() override;
virtual void Initialize() override;

View File

@ -293,6 +293,8 @@ message MFObstacleFull
optional int32 obj_uniid = 1; //id
optional MFVec2 pos = 2; //
optional float scale = 3; //
// born_frameno == SMUpdate.frmanoe时表示在当前这帧出生(0)
optional int32 born_frameno = 4 [default = 0];
optional int32 obstacle_id = 6; //id
optional float health = 7; //