From 307c6d3f99ab86bf45e64f694004c6bd9510fbcf Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Sun, 1 Jan 2023 16:58:01 +0800 Subject: [PATCH] 1 --- server/gameserver/room.cc | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index 1c1d5a02..2c505b1e 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -487,15 +487,9 @@ void Room::DropItemEx(Position born_pos, Position pos, int item_id, int item_cou if (drop_num < 1) { drop_num = 1; } - // 999 - #if 1 - #else - { - a8::Vec2 dir = a8::Vec2::UP; - dir.Rotate(a8::RandAngle()); - pos = pos + dir * (25 + rand() % 50); - } - #endif + glm::vec3 dir = GlmHelper::UP; + GlmHelper::RotateY(dir, a8::RandAngle()); + pos.AddGlmVec3(dir * (25.0f + rand() % 50)); CreateLootEx(item_id, born_pos, pos, drop_num, item_lv, show_anim); total_count -= drop_num; } @@ -818,10 +812,6 @@ void Room::AdjustPosInnerMap(Position& pos, float radius) // 999 pos.x = 1800; pos.y = 1800; - #if 1 - #else - pos = a8::Vec2(1800, 1800); - #endif #ifdef DEBUG A8_ABORT(); #endif @@ -1391,19 +1381,8 @@ bool Room::GenSmallCircle() gas_data_.pos_list->_poses[gas_data_.gas_count + 1].z ); } else { - #if 1 gas_data_.pos_new = glm::vec2(gas_data_.new_area_meta->x1(), gas_data_.new_area_meta->y1()); - #else - a8::Vec2 dir = a8::Vec2::UP; - dir.Rotate(a8::RandAngle()); - float rad = rand() % (int)(gas_data_.old_area_meta->rad() - - gas_data_.new_area_meta->rad()); - if (rad <= 0.001f){ - rad = 0.001f; - } - gas_data_.pos_new = gas_data_.pos_old + dir * rad; - #endif } return true; } @@ -1789,17 +1768,12 @@ RoomObstacle* Room::InternalCreateObstacle(int id, float x, float y, RoomObstacle* entity = EntityFactory::Instance()->MakeRoomObstacle(AllocUniid()); entity->meta = thing; entity->room = this; - // 999 - #if 1 { Position pos; pos.x = x; - pos.y = y; + pos.z = y; entity->SetPos(pos); } - #else - entity->SetPos(a8::Vec2(x, y)); - #endif entity->Initialize(); if (on_precreate) { on_precreate(entity);