diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index 9fdfb3a..52df476 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -851,7 +851,8 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff) break; case kBET_SummonHero: { - SummonHero(GetPos(), + SummonHero(buff, + GetPos(), GetMoveDir(), buff->meta->hero_infos); } @@ -871,7 +872,7 @@ void Creature::ProcBuffEffect(Creature* caster, Buff* buff) if (!dead) { a8::Vec2 target_pos = caster->GetPos() + caster->skill_dir_ * caster->skill_distance_; target_pos = buff_vec2_param1; - SummonObstacle(buff->meta->param1, target_pos); + SummonObstacle(buff, buff->meta->param1, target_pos); } } break; @@ -1388,7 +1389,7 @@ void Creature::CheckSpecObject() #endif } -RoomObstacle* Creature::SummonObstacle(int id, const a8::Vec2& pos) +RoomObstacle* Creature::SummonObstacle(Buff* buff, int id, const a8::Vec2& pos) { RoomObstacle* obstacle = room->CreateObstacle(id, pos.x, pos.y); if (obstacle) { @@ -1396,7 +1397,7 @@ RoomObstacle* Creature::SummonObstacle(int id, const a8::Vec2& pos) obstacle->SetTeamId(room, team_id); obstacle->SetMasterId(room, GetEntityUniId()); obstacle->Active(); - slave_things_.push_back(obstacle); + slave_things_.push_back(std::make_tuple(buff->meta->i->buff_id(), obstacle)); } else { abort(); } @@ -1514,7 +1515,8 @@ void Creature::ResetAllSkillCd() } } -void Creature::SummonHero(const a8::Vec2& pos, +void Creature::SummonHero(Buff* buff, + const a8::Vec2& pos, const a8::Vec2& dir, std::vector>& infos) { @@ -1548,7 +1550,7 @@ void Creature::SummonHero(const a8::Vec2& pos, dir, team_id ); - slave_heros_.push_back(hero); + slave_heros_.push_back(std::make_tuple(buff->meta->i->buff_id(), hero)); break; } } @@ -1582,6 +1584,7 @@ void Creature::SlaveOnRemove(Entity* slave) { abort(); } + break; } } diff --git a/server/gameserver/creature.h b/server/gameserver/creature.h index aea9710..1178aa4 100644 --- a/server/gameserver/creature.h +++ b/server/gameserver/creature.h @@ -135,8 +135,9 @@ class Creature : public MoveableEntity void CheckSpecObject(); bool CollisonDetection(); - RoomObstacle* SummonObstacle(int id, const a8::Vec2& pos); - void SummonHero(const a8::Vec2& pos, + RoomObstacle* SummonObstacle(Buff* buff, int id, const a8::Vec2& pos); + void SummonHero(Buff* buff, + const a8::Vec2& pos, const a8::Vec2& dir, std::vector>& infos); void FillSkillCasterState(SkillCasterState* caster_state); @@ -186,8 +187,8 @@ private: std::array buff_attr_rate_ = {}; std::array buff_effect_ = {}; std::list buff_list_; - std::list slave_heros_; - std::list slave_things_; + std::list> slave_heros_; + std::list> slave_things_; a8::Vec2 skill_dir_; float skill_param1 = 0;