1
This commit is contained in:
parent
cbb78fed41
commit
ec506459b2
@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 2.8)
|
||||
set(GAME_ID 2002)
|
||||
|
||||
set(CMAKE_BUILD_TYPE "Debug")
|
||||
set(CMAKE_BUILD_TYPE "Release")
|
||||
#set(CMAKE_BUILD_TYPE "Release")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DA8_TCP_SESSION2=1")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-Wall -g -std=gnu++11 -DGAME_ID=${GAME_ID} -DA8_TCP_SESSION2=1")
|
||||
|
||||
|
@ -333,16 +333,25 @@ void Room::CreateThings()
|
||||
std::vector<MetaData::MapTplThing>* things = MetaMgr::Instance()->GetMapTplThing(map_tpl_name);
|
||||
if (things) {
|
||||
for (auto& thing_tpl : *things) {
|
||||
if (thing_tpl.i->is_born_point()) {
|
||||
continue;
|
||||
}
|
||||
if (thing_tpl.i->weight() >= rand() % 10000) {
|
||||
int thing_id = thing_tpl.RandThing();
|
||||
MetaData::MapThing* thing_meta = MetaMgr::Instance()->GetMapThing(thing_id);
|
||||
#if 0
|
||||
assert(thing_meta);
|
||||
#endif
|
||||
if (thing_meta) {
|
||||
#if 1
|
||||
CreateObstacle(thing_id, thing_tpl.i->x(), thing_tpl.i->y());
|
||||
#else
|
||||
if (thing_meta->i->is_house()) {
|
||||
CreateBuilding(thing_id, thing_tpl.i->x(), thing_tpl.i->y());
|
||||
} else {
|
||||
CreateObstacle(thing_id, thing_tpl.i->x(), thing_tpl.i->y());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -369,6 +378,7 @@ void Room::DropItem(a8::Vec2 pos, int item_id, int item_count, int item_lv)
|
||||
|
||||
void Room::CreateBuilding(int thing_id, float building_x, float building_y)
|
||||
{
|
||||
#if 0
|
||||
MetaData::MapThing* thing_meta = MetaMgr::Instance()->GetMapThing(thing_id);
|
||||
if (!thing_meta) {
|
||||
return;
|
||||
@ -431,6 +441,7 @@ void Room::CreateBuilding(int thing_id, float building_x, float building_y)
|
||||
);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Obstacle* Room::CreateObstacle(int id, float x, float y)
|
||||
|
@ -30,10 +30,6 @@ message MapThing
|
||||
optional float damage_dia = 7; //伤害半径
|
||||
optional int32 drop = 8; //掉落
|
||||
optional int32 attack_type = 9; //是否可攻击 0:不可破坏对象 1:可破坏对象 2:可穿透对象
|
||||
optional int32 is_door = 10; //是否门
|
||||
optional int32 is_house = 11; //是否房间
|
||||
optional int32 is_tree = 12; //是否树
|
||||
optional int32 house_id = 13; //房间id
|
||||
}
|
||||
|
||||
message SafeArea
|
||||
@ -229,4 +225,5 @@ message MapTplThingJson
|
||||
optional int32 weight = 4;
|
||||
optional float x = 5;
|
||||
optional float y = 6;
|
||||
optional int32 is_born_point = 7;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user