修复视野问题
This commit is contained in:
parent
eaf14c67fc
commit
e6d60ff750
@ -878,6 +878,20 @@ void Human::OnGridListChange(std::set<GridCell*>& old_grid_list,
|
|||||||
hum->AddToPartObjects(this);
|
hum->AddToPartObjects(this);
|
||||||
AddToNewObjects(hum);
|
AddToNewObjects(hum);
|
||||||
AddToPartObjects(hum);
|
AddToPartObjects(hum);
|
||||||
|
#if 1
|
||||||
|
{
|
||||||
|
hum->SendDebugMsg(a8::Format("myself:%d uniid:%d name:%s 进入你的视野",
|
||||||
|
{
|
||||||
|
hum->entity_uniid,
|
||||||
|
entity_uniid,
|
||||||
|
name}));
|
||||||
|
SendDebugMsg(a8::Format("myself:%d uniid:%d name:%s 进入你的视野",
|
||||||
|
{
|
||||||
|
entity_uniid,
|
||||||
|
hum->entity_uniid,
|
||||||
|
hum->name}));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Entity* entity : cell->entity_list) {
|
for (Entity* entity : cell->entity_list) {
|
||||||
@ -899,9 +913,24 @@ void Human::OnGridListChange(std::set<GridCell*>& old_grid_list,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (GridCell* cell : dec_grid_list) {
|
for (GridCell* cell : dec_grid_list) {
|
||||||
for (Human* entity : cell->human_list) {
|
for (Human* hum : cell->human_list) {
|
||||||
if (!room->grid_service.HumanInGridList(entity, grid_list)) {
|
if (!room->grid_service.HumanInGridList(hum, grid_list)) {
|
||||||
OutObjects(entity);
|
OutObjects(hum);
|
||||||
|
hum->OutObjects(this);
|
||||||
|
#if 1
|
||||||
|
{
|
||||||
|
hum->SendDebugMsg(a8::Format("myself:%d uniid:%d name:%s 退出你的视野",
|
||||||
|
{
|
||||||
|
hum->entity_uniid,
|
||||||
|
entity_uniid,
|
||||||
|
name}));
|
||||||
|
SendDebugMsg(a8::Format("myself:%d uniid:%d name:%s 退出你的视野",
|
||||||
|
{
|
||||||
|
entity_uniid,
|
||||||
|
hum->entity_uniid,
|
||||||
|
hum->name}));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Entity* entity : cell->entity_list) {
|
for (Entity* entity : cell->entity_list) {
|
||||||
@ -1338,6 +1367,13 @@ void Human::FollowTarget(Human* target)
|
|||||||
follow_synced_active_player = false;
|
follow_synced_active_player = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Human::SendDebugMsg(const std::string& debug_msg)
|
||||||
|
{
|
||||||
|
cs::SMDebugMsg notify_msg;
|
||||||
|
notify_msg.set_debug_msg(debug_msg);
|
||||||
|
SendNotifyMsg(notify_msg);
|
||||||
|
}
|
||||||
|
|
||||||
void Human::ClearFrameData()
|
void Human::ClearFrameData()
|
||||||
{
|
{
|
||||||
if (!new_objects.empty()) {
|
if (!new_objects.empty()) {
|
||||||
@ -1359,7 +1395,7 @@ void Human::ClearFrameData()
|
|||||||
part_objects.erase(entity);
|
part_objects.erase(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
del_objects.clear();
|
out_objects.clear();
|
||||||
}
|
}
|
||||||
if (!shots_.empty()) {
|
if (!shots_.empty()) {
|
||||||
shots_.clear();
|
shots_.clear();
|
||||||
|
@ -168,6 +168,7 @@ class Human : public Entity
|
|||||||
}
|
}
|
||||||
void UpdateGameOver();
|
void UpdateGameOver();
|
||||||
void FollowTarget(Human* target);
|
void FollowTarget(Human* target);
|
||||||
|
void SendDebugMsg(const std::string& debug_msg);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ClearFrameData();
|
void ClearFrameData();
|
||||||
|
@ -29,4 +29,5 @@ enum SMMessageId_e
|
|||||||
_SMVoiceNotify = 1007;
|
_SMVoiceNotify = 1007;
|
||||||
_SMDisconnectNotify = 1008;
|
_SMDisconnectNotify = 1008;
|
||||||
_SMGameOver = 1009;
|
_SMGameOver = 1009;
|
||||||
|
_SMDebugMsg = 1010;
|
||||||
}
|
}
|
||||||
|
@ -760,3 +760,9 @@ message SMVoiceNotify
|
|||||||
optional string account_id = 2; //唯一id
|
optional string account_id = 2; //唯一id
|
||||||
optional string download_url = 3; //语音下载地址
|
optional string download_url = 3; //语音下载地址
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//调试信息
|
||||||
|
message SMDebugMsg
|
||||||
|
{
|
||||||
|
optional string debug_msg = 3; //调试信息
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user