diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 566e730..13c2e97 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -93,6 +93,8 @@ void Human::FillMFObjectPart(cs::MFObjectPart* part_data) p->set_obj_uniid(entity_uniid); TypeConvert::ToPb(pos, p->mutable_pos()); TypeConvert::ToPb(attack_dir, p->mutable_dir()); + p->set_health(health); + p->set_max_health(GetMaxHP()); } void Human::FillMFObjectFull(cs::MFObjectFull* full_data) diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index 1fbbe92..cb85812 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -124,6 +124,9 @@ message MFPlayerPart optional int32 obj_uniid = 1; //唯一id optional MFVector2D pos = 2; //位置 optional MFVector2D dir = 3; //朝向 + + optional float max_health = 5; //血量上限(只有变化时才发,没变化时为undefined) + optional float health = 6; //血量(只有变化时才发,没变化时为undefined) } //玩家信息-全量