修复7.屏幕外,队友乘坐机甲,同屏后对方未显示机甲
This commit is contained in:
parent
b18ef9040b
commit
7e6e22b6b6
@ -61,6 +61,15 @@ class Creature : public MoveableEntity
|
|||||||
virtual ~Creature() override;
|
virtual ~Creature() override;
|
||||||
virtual void Initialize() override;
|
virtual void Initialize() override;
|
||||||
virtual void SetMoveDir(const a8::Vec2& move_dir) override;
|
virtual void SetMoveDir(const a8::Vec2& move_dir) override;
|
||||||
|
virtual void AddToNewObjects(Entity* entity) {};
|
||||||
|
virtual void AddToPartObjects(Entity* entity) {};
|
||||||
|
virtual void RemovePartObjects(Entity* entity) {};
|
||||||
|
virtual bool InNewObjects(Entity* target) { return false; };
|
||||||
|
virtual bool InPartObjects(Entity* target) { return false; };
|
||||||
|
virtual int GetPartObjectsCount() { return 0; };
|
||||||
|
virtual void RemoveObjects(Entity* entity) {};
|
||||||
|
virtual void AddOutObjects(Entity* entity) {};
|
||||||
|
virtual void RemoveOutObjects(Entity* entity) {};
|
||||||
bool HasBuffEffect(int buff_effect_id);
|
bool HasBuffEffect(int buff_effect_id);
|
||||||
Buff* GetBuffByEffectId(int effect_id);
|
Buff* GetBuffByEffectId(int effect_id);
|
||||||
Buff* GetBuffById(int buff_id);
|
Buff* GetBuffById(int buff_id);
|
||||||
|
@ -2900,19 +2900,19 @@ void Human::ProcIncGridList(std::set<GridCell*>& old_grids,
|
|||||||
std::set<GridCell*>& inc_grids,
|
std::set<GridCell*>& inc_grids,
|
||||||
std::set<GridCell*>& dec_grids)
|
std::set<GridCell*>& dec_grids)
|
||||||
{
|
{
|
||||||
room->grid_service->TraverseAllLayerHumanList
|
room->grid_service->TraverseCreatures
|
||||||
(
|
(
|
||||||
room->GetRoomIdx(),
|
room->GetRoomIdx(),
|
||||||
inc_grids,
|
inc_grids,
|
||||||
[this, &old_grids] (Human* hum, bool& stop)
|
[this, &old_grids] (Creature* c, bool& stop)
|
||||||
{
|
{
|
||||||
if (!room->grid_service->CreatureInGridList(hum, old_grids)) {
|
if (!room->grid_service->CreatureInGridList(c, old_grids)) {
|
||||||
hum->AddToNewObjects(this);
|
c->AddToNewObjects(this);
|
||||||
hum->AddToPartObjects(this);
|
c->AddToPartObjects(this);
|
||||||
hum->RemoveOutObjects(this);
|
c->RemoveOutObjects(this);
|
||||||
AddToNewObjects(hum);
|
AddToNewObjects(c);
|
||||||
AddToPartObjects(hum);
|
AddToPartObjects(c);
|
||||||
RemoveOutObjects(hum);
|
RemoveOutObjects(c);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
room->grid_service->TraverseAllLayerEntityList
|
room->grid_service->TraverseAllLayerEntityList
|
||||||
@ -2942,21 +2942,21 @@ void Human::ProcDecGridList(std::set<GridCell*>& old_grids,
|
|||||||
std::set<GridCell*>& inc_grids,
|
std::set<GridCell*>& inc_grids,
|
||||||
std::set<GridCell*>& dec_grids)
|
std::set<GridCell*>& dec_grids)
|
||||||
{
|
{
|
||||||
room->grid_service->TraverseAllLayerHumanList
|
room->grid_service->TraverseCreatures
|
||||||
(
|
(
|
||||||
room->GetRoomIdx(),
|
room->GetRoomIdx(),
|
||||||
dec_grids,
|
dec_grids,
|
||||||
[this] (Human* hum, bool& stop)
|
[this] (Creature* c, bool& stop)
|
||||||
{
|
{
|
||||||
if (!room->grid_service->CreatureInGridList(hum, GetGridList())) {
|
if (!room->grid_service->CreatureInGridList(c, GetGridList())) {
|
||||||
AddOutObjects(hum);
|
AddOutObjects(c);
|
||||||
hum->AddOutObjects(this);
|
c->AddOutObjects(this);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
#if 0
|
#if 0
|
||||||
a8::UdpLog::Instance()->Debug("addoutobjects %d %d",
|
a8::UdpLog::Instance()->Debug("addoutobjects %d %d",
|
||||||
{
|
{
|
||||||
(long long)hum,
|
(long long)c,
|
||||||
hum->GetEntityUniId()
|
c->GetEntityUniId()
|
||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -169,15 +169,15 @@ class Human : public Creature
|
|||||||
void FindPathInMapService();
|
void FindPathInMapService();
|
||||||
void BeKill(int killer_id, const std::string& killer_name, int weapon_id);
|
void BeKill(int killer_id, const std::string& killer_name, int weapon_id);
|
||||||
virtual void DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id) override;
|
virtual void DecHP(float dec_hp, int killer_id, const std::string& killer_name, int weapon_id) override;
|
||||||
void AddToNewObjects(Entity* entity);
|
virtual void AddToNewObjects(Entity* entity) override;
|
||||||
void AddToPartObjects(Entity* entity);
|
virtual void AddToPartObjects(Entity* entity) override;
|
||||||
void RemovePartObjects(Entity* entity);
|
virtual void RemovePartObjects(Entity* entity) override;
|
||||||
bool InNewObjects(Entity* target);
|
virtual bool InNewObjects(Entity* target) override;
|
||||||
bool InPartObjects(Entity* target);
|
virtual bool InPartObjects(Entity* target) override;
|
||||||
int GetPartObjectsCount();
|
virtual int GetPartObjectsCount() override;
|
||||||
void RemoveObjects(Entity* entity);
|
virtual void RemoveObjects(Entity* entity) override;
|
||||||
void AddOutObjects(Entity* entity);
|
virtual void AddOutObjects(Entity* entity) override;
|
||||||
void RemoveOutObjects(Entity* entity);
|
virtual void RemoveOutObjects(Entity* entity) override;
|
||||||
bool HasLiveTeammate();
|
bool HasLiveTeammate();
|
||||||
bool HasNoDownedTeammate();
|
bool HasNoDownedTeammate();
|
||||||
int GetNearbyTeammateNum(float range);
|
int GetNearbyTeammateNum(float range);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user