1
This commit is contained in:
parent
edf7d6f0bb
commit
d83b3b04f0
@ -11,6 +11,11 @@ bool DebugCmd::Enable()
|
|||||||
return App::Instance()->instance_id == 6;
|
return App::Instance()->instance_id == 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DebugCmd::EnableNewMap()
|
||||||
|
{
|
||||||
|
return App::Instance()->instance_id == 3;
|
||||||
|
}
|
||||||
|
|
||||||
void DebugCmd::CreateSphere(Creature* c,
|
void DebugCmd::CreateSphere(Creature* c,
|
||||||
const glm::vec3& pos,
|
const glm::vec3& pos,
|
||||||
const glm::vec3& scale,
|
const glm::vec3& scale,
|
||||||
|
@ -11,6 +11,7 @@ class DebugCmd
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
static bool Enable();
|
static bool Enable();
|
||||||
|
static bool EnableNewMap();
|
||||||
|
|
||||||
static void CreateSphere(Creature* c,
|
static void CreateSphere(Creature* c,
|
||||||
const glm::vec3& pos,
|
const glm::vec3& pos,
|
||||||
|
@ -108,7 +108,13 @@ void MapInstance::Init()
|
|||||||
MAP_GRID_WIDTH);
|
MAP_GRID_WIDTH);
|
||||||
{
|
{
|
||||||
navmesh_ = dtAllocNavMesh();
|
navmesh_ = dtAllocNavMesh();
|
||||||
FILE *fp = fopen((mt::MetaMgr::Instance()->GetResDir() + "map4.bin").c_str(), "rb");
|
std::string navmesh_file = "map4.bin";
|
||||||
|
#ifdef DEBUG
|
||||||
|
if (DebugCmd::EnableNewMap() && map_id == 2002) {
|
||||||
|
navmesh_file = "map5.bin";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
FILE *fp = fopen((mt::MetaMgr::Instance()->GetResDir() + navmesh_file).c_str(), "rb");
|
||||||
if(fp){
|
if(fp){
|
||||||
//fseek(fp, 0, SEEK_END);
|
//fseek(fp, 0, SEEK_END);
|
||||||
//int file_size = ftell(fp);
|
//int file_size = ftell(fp);
|
||||||
@ -1245,6 +1251,11 @@ void MapInstance::MarkConnectablePolys()
|
|||||||
dtPolyRef startRef = INVALID_NAVMESH_POLYREF;
|
dtPolyRef startRef = INVALID_NAVMESH_POLYREF;
|
||||||
{
|
{
|
||||||
glm::vec3 pos = glm::vec3(5120.000000000000f, 6.250846862793f, 5120.000000000000f);
|
glm::vec3 pos = glm::vec3(5120.000000000000f, 6.250846862793f, 5120.000000000000f);
|
||||||
|
#ifdef DEBUG
|
||||||
|
if (DebugCmd::EnableNewMap() && map_id == 2002) {
|
||||||
|
pos = glm::vec3(287.000000000000f, 6.19, 453);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
dtQueryFilter filter;
|
dtQueryFilter filter;
|
||||||
filter.setIncludeFlags(0xffff);
|
filter.setIncludeFlags(0xffff);
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include "room.h"
|
#include "room.h"
|
||||||
#include "mapinstance.h"
|
#include "mapinstance.h"
|
||||||
#include "roommgr.h"
|
#include "roommgr.h"
|
||||||
|
#include "debugcmd.h"
|
||||||
|
|
||||||
#include "mt/Map.h"
|
#include "mt/Map.h"
|
||||||
#include "mt/PveGemini.h"
|
#include "mt/PveGemini.h"
|
||||||
@ -17,7 +18,11 @@ void MapMgr::Init()
|
|||||||
[this] (const mt::Map* map_meta, bool& stop)
|
[this] (const mt::Map* map_meta, bool& stop)
|
||||||
{
|
{
|
||||||
if (map_meta->map_id() == 2001 ||
|
if (map_meta->map_id() == 2001 ||
|
||||||
map_meta->map_id() == 1003
|
map_meta->map_id() == 1003 ||
|
||||||
|
#ifdef DEBUG
|
||||||
|
(DebugCmd::EnableNewMap() && map_meta->map_id() == 2002) ||
|
||||||
|
#endif
|
||||||
|
false
|
||||||
) {
|
) {
|
||||||
auto map_instance = std::make_shared<MapInstance>();
|
auto map_instance = std::make_shared<MapInstance>();
|
||||||
map_instance->map_id = map_meta->map_id();
|
map_instance->map_id = map_meta->map_id();
|
||||||
@ -98,6 +103,11 @@ void MapMgr::AttachRoom(Room* room, RoomInitInfo& init_info)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef DEBUG
|
||||||
|
if (DebugCmd::EnableNewMap()) {
|
||||||
|
map_instance = GetMapInstance(2002);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!map_instance) {
|
if (!map_instance) {
|
||||||
A8_ABORT();
|
A8_ABORT();
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "guide.h"
|
#include "guide.h"
|
||||||
#include "mapinstance.h"
|
#include "mapinstance.h"
|
||||||
#include "compose.h"
|
#include "compose.h"
|
||||||
|
#include "debugcmd.h"
|
||||||
|
|
||||||
#include "mt/Param.h"
|
#include "mt/Param.h"
|
||||||
#include "mt/Equip.h"
|
#include "mt/Equip.h"
|
||||||
@ -1439,6 +1440,11 @@ void Player::PushJoinRoomMsg()
|
|||||||
notifymsg.set_map_id(room->GetMapMeta()->map_id());
|
notifymsg.set_map_id(room->GetMapMeta()->map_id());
|
||||||
#if 1
|
#if 1
|
||||||
notifymsg.set_map_id(1001);
|
notifymsg.set_map_id(1001);
|
||||||
|
#endif
|
||||||
|
#ifdef DEBUG
|
||||||
|
if (DebugCmd::EnableNewMap()) {
|
||||||
|
notifymsg.set_map_id(room->GetMapMeta()->map_id());
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
notifymsg.set_map_width(room->GetMapMeta()->map_width());
|
notifymsg.set_map_width(room->GetMapMeta()->map_width());
|
||||||
notifymsg.set_map_height(room->GetMapMeta()->map_height());
|
notifymsg.set_map_height(room->GetMapMeta()->map_height());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user