1
This commit is contained in:
parent
c334c8537a
commit
55e45b5623
@ -358,11 +358,11 @@ void BattleDataContext::ParseResult(a8::XObject& obj)
|
|||||||
match_mode_ = obj.Get("match_mode");
|
match_mode_ = obj.Get("match_mode");
|
||||||
}
|
}
|
||||||
level_ = obj.HasKey("level") ? obj.Get("level").GetInt() : 1;
|
level_ = obj.HasKey("level") ? obj.Get("level").GetInt() : 1;
|
||||||
skin_id_ = obj.HasKey("skin_id") ? obj.Get("skin_id").GetInt() : 0;
|
|
||||||
if (obj.HasKey("hero_dto") && obj.At("hero_dto")->IsObject()) {
|
if (obj.HasKey("hero_dto") && obj.At("hero_dto")->IsObject()) {
|
||||||
hero_dto = obj.At("hero_dto");
|
hero_dto = obj.At("hero_dto");
|
||||||
hero_ability_->hero_uniid_ = hero_dto->Get("hero_uniid", "");
|
hero_ability_->hero_uniid_ = hero_dto->Get("hero_uniid", "");
|
||||||
hero_ability_->hero_dto = hero_dto;;
|
hero_ability_->hero_dto = hero_dto;
|
||||||
|
skin_id_ = hero_dto->HasKey("skin_id") ? hero_dto->Get("skin_id").GetInt() : 0;
|
||||||
const mt::Hero* meta = mt::Hero::GetById(hero_dto->Get("hero_id", ""));
|
const mt::Hero* meta = mt::Hero::GetById(hero_dto->Get("hero_id", ""));
|
||||||
if (meta) {
|
if (meta) {
|
||||||
hero_ability_->hero_meta = meta;
|
hero_ability_->hero_meta = meta;
|
||||||
@ -733,16 +733,11 @@ void BattleDataContext::Init(Creature* c)
|
|||||||
weapon2_ability_->Init(c);
|
weapon2_ability_->Init(c);
|
||||||
}
|
}
|
||||||
if (skin_id_ && c->IsHuman()) {
|
if (skin_id_ && c->IsHuman()) {
|
||||||
#if 1
|
|
||||||
Skin* skin = c->AsHuman()->GetSkinByIdx(0);
|
|
||||||
skin->skin_id = 1;
|
|
||||||
#else
|
|
||||||
const mt::Item* item_meta = mt::Item::GetById(skin_id_);
|
const mt::Item* item_meta = mt::Item::GetById(skin_id_);
|
||||||
if (item_meta) {
|
if (item_meta) {
|
||||||
Skin* skin = c->AsHuman()->GetSkinByIdx(0);
|
Skin* skin = c->AsHuman()->GetSkinByIdx(0);
|
||||||
skin->skin_id = skin_id_;
|
skin->skin_id = skin_id_;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user