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