This commit is contained in:
aozhiwei 2024-04-26 17:00:48 +08:00
parent f1f422f11a
commit 4c713803eb

View File

@ -97,6 +97,28 @@ static bool LoadOtherHeroAnimi(const std::string key,
a8::ReplaceString(id_str, key, "other");
int id = a8::XValue(id_str);
std::vector<std::string> keys;
anim_xobj->GetKeys(keys);
for (auto& tmp_key : keys) {
auto act_xobj = anim_xobj->At(tmp_key);
int act_id = a8::XValue(tmp_key).GetInt();
int h = act_xobj->At("h")->AsXValue().GetInt();
int t = act_xobj->At("t")->AsXValue().GetInt() * 1000;
float x = act_xobj->At("x")->AsXValue().GetDouble();
float y = act_xobj->At("y")->AsXValue().GetDouble();
float z = act_xobj->At("z")->AsXValue().GetDouble();
mt::HeroShotAnimationOther o;
o.hand = h;
o.t = t;
o.x = x;
o.y = y;
o.z = z;
anim.other_list.push_back(o);
}
anim.id = id;
anim.is_other = 1;
return true;
}
@ -292,8 +314,13 @@ namespace mt
const HeroShotAnimation* Hero::GetShotAnimi(int shotfire) const
{
auto itr = shot_animations.find(shotfire);
return itr != shot_animations.end() ? &itr->second : nullptr;
if (_other_keys.empty()) {
auto itr = shot_animations.find(shotfire);
return itr != shot_animations.end() ? &itr->second : nullptr;
} else {
auto itr = other_shot_animations.find(shotfire);
return itr != other_shot_animations.end() ? &itr->second : nullptr;
}
}
void Hero::LoadHeroAndEquipShotData()