1
This commit is contained in:
parent
e22ede9fce
commit
e594484a5e
@ -2072,20 +2072,22 @@ void Creature::SummonHero(Buff* buff,
|
||||
int num = std::get<4>(info);
|
||||
MetaData::Player* hero_meta = MetaMgr::Instance()->GetPlayer(hero_id);
|
||||
if (hero_meta) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
a8::Vec2 born_dir = dir;
|
||||
a8::Vec2 born_offset(x, y);
|
||||
born_offset.Rotate(born_dir.CalcAngle(a8::Vec2::UP));
|
||||
born_offset.Rotate(i * 0.5);
|
||||
a8::Vec2 hero_pos = pos + born_offset;
|
||||
Hero* hero = InternalSummonHero(hero_meta,
|
||||
dir,
|
||||
hero_pos,
|
||||
through_wall);
|
||||
if (hero) {
|
||||
RemoveSurplusHero(buff->meta->i->buff_id(), hero_id, num);
|
||||
slave_heros_.push_back(std::make_tuple(buff->meta->i->buff_id(), hero));
|
||||
break;
|
||||
for (int j = 0; j < num; ++j) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
a8::Vec2 born_dir = dir;
|
||||
a8::Vec2 born_offset(x, y);
|
||||
born_offset.Rotate(born_dir.CalcAngle(a8::Vec2::UP));
|
||||
born_offset.Rotate(i * 0.5);
|
||||
a8::Vec2 hero_pos = pos + born_offset;
|
||||
Hero* hero = InternalSummonHero(hero_meta,
|
||||
dir,
|
||||
hero_pos,
|
||||
through_wall);
|
||||
if (hero) {
|
||||
RemoveSurplusHero(buff->meta->i->buff_id(), hero_id, num);
|
||||
slave_heros_.push_back(std::make_tuple(buff->meta->i->buff_id(), hero));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user