From b7f0aae4facedd60d593ac8a2978352d7cbf968b Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 28 Sep 2022 15:13:49 +0800 Subject: [PATCH] 1 --- server/gameserver/incubator.cc | 14 ++++++++------ server/tools/protobuild/cs_proto.proto | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/server/gameserver/incubator.cc b/server/gameserver/incubator.cc index a8fcd1d6..f2349977 100644 --- a/server/gameserver/incubator.cc +++ b/server/gameserver/incubator.cc @@ -296,18 +296,20 @@ void Incubator::SpawnWaveMon(int wave) a8::XParams() .SetSender(this) .SetParam1(content) - .SetParam2(room) - .SetParam3(wave), + .SetParam2(wave) + .SetParam3(i), [] (const a8::XParams& param) { + Incubator* incubator = (Incubator*)param.sender.GetUserData(); MetaData::PveGeminiContent* content = (MetaData::PveGeminiContent*)param.param1.GetUserData(); - Room* room = (Room*)param.param2.GetUserData(); - int wave = param.param3.GetInt(); + Room* room = incubator->room; + int wave = param.param2.GetInt(); + int idx = param.param3.GetInt(); #ifdef DEBUG a8::XPrintf("wave i:%d enemys_size:%d\n", {wave, content->enemys.size()}); #endif - if (param.param3.GetInt() < content->enemys.size()) { - int enemy_id = content->enemys[param.param3.GetInt()]; + if (idx < content->enemys.size()) { + int enemy_id = content->enemys[idx]; MetaData::Player* hero_meta = MetaMgr::Instance()->GetPlayer(enemy_id); if (hero_meta) { a8::Vec2 hero_pos = content->spawn_point; diff --git a/server/tools/protobuild/cs_proto.proto b/server/tools/protobuild/cs_proto.proto index cf7e587c..4fcbe5cf 100755 --- a/server/tools/protobuild/cs_proto.proto +++ b/server/tools/protobuild/cs_proto.proto @@ -494,7 +494,23 @@ message MFActivePlayerData repeated int32 inventory = 11; //库存 optional int32 cur_weapon_idx = 15; //当前武器索引 0-4 - repeated MFWeapon weapons = 16; //武器列表1-4 0:拳头 1:枪 2:枪 3:手雷 4:烟雾弹 + /* + 武器列表1-4 + 0:拳头 + 1:枪1 + 2:枪2 + 3:手雷 + 4:烟雾弹 + 5: 毒气弹 + 6: 燃烧瓶 + 7: 陷阱 + 8: 地雷 + 9: c4 + 10: 盾墙 + 11: 信号抢 + 12: 汽油桶 + */ + repeated MFWeapon weapons = 16; optional int32 energy_shield = 40; //能量护盾 optional int32 max_energy_shield = 41; //最大能量护盾