From eadd44c8bebdb5121053fc5924bf974a9d2760bd Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 22 Apr 2024 20:03:27 +0800 Subject: [PATCH] 1 --- server/gameserver/car.cc | 5 ----- server/gameserver/car.h | 1 - server/gameserver/creature.cc | 6 ++++++ server/gameserver/creature.h | 3 ++- server/gameserver/hero.cc | 5 ----- server/gameserver/hero.h | 1 - server/gameserver/human.cc | 5 ----- server/gameserver/human.h | 1 - server/tools/protobuild/cs_proto.proto | 2 ++ 9 files changed, 10 insertions(+), 19 deletions(-) diff --git a/server/gameserver/car.cc b/server/gameserver/car.cc index 5a40e9c7..6af00024 100644 --- a/server/gameserver/car.cc +++ b/server/gameserver/car.cc @@ -296,11 +296,6 @@ float Car::GetRadius() return hero_meta_->radius(); } -float Car::GetSpeed() -{ - return Creature::GetSpeed(); -} - void Car::OnBulletHit(IBullet* bullet) { if (!IsDead(room)) { diff --git a/server/gameserver/car.h b/server/gameserver/car.h index b2eb14f6..f8099773 100644 --- a/server/gameserver/car.h +++ b/server/gameserver/car.h @@ -39,7 +39,6 @@ class Car : public Creature void DecOil(float dec_oil); bool HasPassenter() { return !passengers_.empty();}; virtual float GetRadius() override; - virtual float GetSpeed() override; virtual void DecHP(float dec_hp, int killer_id, const std::string killer_name, int weapon_id, int real_killer_id, const std::string real_killer_name, diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index bf3714a7..28a6f91a 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -3337,6 +3337,12 @@ float Creature::GetSafeAreaRaidus() } float Creature::GetSpeed() +{ + float speed = InternalGetSpeed(); + return speed; +} + +float Creature::InternalGetSpeed() { const float min_speed = 30.0f; const float base_speed = GetHeroMeta()->move_speed(); diff --git a/server/gameserver/creature.h b/server/gameserver/creature.h index 5e71c645..79745180 100644 --- a/server/gameserver/creature.h +++ b/server/gameserver/creature.h @@ -159,7 +159,7 @@ class Creature : public MoveableEntity virtual const mt::BattleHeroGrow* GetHeroGrowMeta() { return hero_grow_meta_; }; virtual void FillMFObjectImage(Room* room, Human* hum, cs::MFCharacterImage* image_data) {}; virtual void SetPos(Position pos) override; - virtual float GetSpeed(); + float GetSpeed(); virtual void LateUpdate(int delta_time) override; std::shared_ptr GetMovement() { return movement_; }; bool HasBuffEffect(int buff_effect_id); @@ -436,6 +436,7 @@ private: bool InternalCanUseSkill(Skill* skill); void InternalUseSkill(); void GenLevelAttr(); + float InternalGetSpeed(); protected: bool need_sync_active_player_ = false; diff --git a/server/gameserver/hero.cc b/server/gameserver/hero.cc index 069ec39d..04e734ef 100644 --- a/server/gameserver/hero.cc +++ b/server/gameserver/hero.cc @@ -239,11 +239,6 @@ void Hero::OnBulletHit(IBullet* bullet) } } -float Hero::GetSpeed() -{ - return Creature::GetSpeed(); -} - void Hero::UpdateMove() { Creature::UpdateMove(); diff --git a/server/gameserver/hero.h b/server/gameserver/hero.h index c5a7bbbe..0f8f93c8 100644 --- a/server/gameserver/hero.h +++ b/server/gameserver/hero.h @@ -34,7 +34,6 @@ public: virtual std::string GetName() override; virtual void DropItems(Obstacle* obstacle) override; virtual const mt::Hero* GetHeroMeta() override { return meta; }; - virtual float GetSpeed() override; virtual float GetRadius() override; virtual float GetHitRadius() override; virtual void OnAddToTargetPartObject(Entity* target) override; diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index ef8c9409..3317ea71 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -111,11 +111,6 @@ void Human::Initialize() SetOxygen(mt::Param::s().dive_oxygen_total); } -float Human::GetSpeed() -{ - return Creature::GetSpeed(); -} - bool Human::IsDead(Room * room) { return dead; diff --git a/server/gameserver/human.h b/server/gameserver/human.h index 68c7b71b..8d5e8a80 100644 --- a/server/gameserver/human.h +++ b/server/gameserver/human.h @@ -148,7 +148,6 @@ class Human : public Creature Human(); virtual ~Human() override; virtual void Initialize() override; - virtual float GetSpeed() override; virtual void FillMFObjectPart(Room* room, Human* hum, cs::MFObjectPart* part_data) override; void FillMFObjectLess(Room* room, Human* hum, cs::MFPlayerFull* full_data); virtual void FillMFObjectFull(Room* room, Human* hum, cs::MFObjectFull* full_data) override; diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index 695ca6fc..d6ca1114 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -1353,6 +1353,8 @@ message MFSettlementNew optional int32 settlement_status = 12; //0: 结算中(读取个人结算数据) 1:已结算(请求小胡接口) optional int32 custom_battle = 13; //是否自定义房间 optional string box_payload = 14; //请求宝箱透传数据(空则不需要请求,客户端需做容错判断改字段是否存在(小胡那边不会传这个字段)) + optional int32 map_mode_id = 15; //map模式配置表id + optional int32 map_mode = 16; //map模式配置 optional int32 pvp_settlement_type = 101; //結算類型0:個人 1:組隊(保留) optional int32 pvp_settlement_color = 102; // 0:灰 1:黃