This commit is contained in:
aozhiwei 2022-12-15 13:09:20 +08:00
parent 7825e7250e
commit d6ff97211e
3 changed files with 19 additions and 8 deletions

View File

@ -422,13 +422,24 @@ int MapInstance::Raycast(int layer, const glm::vec3& start, const glm::vec3& end
hit_pos_[1] = h;
}
#ifdef DEBUG
for (int i = 0; i < npolys; ++i) {
auto itr = poly_hash.find(polys_[i]);
if (itr != poly_hash.end()) {
} else {
abort();
{
std::string dbg_data = a8::Format("npolys:%d ", {npolys});
for (int i = 0; i < npolys; ++i) {
auto itr = poly_hash.find(polys_[i]);
if (itr != poly_hash.end()) {
auto tile = std::get<0>(itr->second);
auto poly = std::get<1>(itr->second);
assert(poly->vertCount > 2);
dbg_data += a8::Format("poly%d: vert_count:%d ", {i + 1, poly->vertCount});
for (int ii = 0; ii < poly->vertCount; ++ii) {
const float* va = &tile->verts[poly->verts[ii] * 3];
dbg_data += a8::Format(" v:%d %f,%f,%f ", {ii, va[0], va[1], va[2]});
}
} else {
abort();
}
}
a8::XPrintf("raycast hit dbg_data:%s\n", {dbg_data});
}
#endif
}

View File

@ -96,7 +96,7 @@ void MoveHelper::CalcTargetPos(float distance)
}
#ifdef DEBUG
if (owner_->IsPlayer()) {
a8::XPrintf("CalcTargetPos src_pos:%f,%f,%f tar_pos:%f,%f,%f is_hit:%d start:%f,%f,%f end:%f,%f,%f distance:%f src_distance\n",
a8::XPrintf("CalcTargetPos src_pos:%f,%f,%f tar_pos:%f,%f,%f is_hit:%d start:%f,%f,%f end:%f,%f,%f distance:%f src_distance:%f\n",
{
point.src_pos.x,
point.src_pos.y,

View File

@ -3385,7 +3385,7 @@ int Room::GetOnlinePlayerNum()
size_t Room::GetRoomMaxPlayerNum()
{
#ifdef MAP3D
return 2;
return 1;
return map_meta_->pb->player();
//return 2;
#else