mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-29 01:35:42 +00:00
Expose battle-start hero vigor correctly (#8639)
This commit is contained in:
@@ -67,7 +67,7 @@ using net::eagle0::shardok::api::HeroView;
|
||||
stats->set_vigor(hero.vigor());
|
||||
|
||||
if (belongsToAsker) {
|
||||
stats->set_starting_vigor(hero.vigor());
|
||||
stats->set_starting_vigor(hero.starting_vigor());
|
||||
|
||||
HeroView::StatXp *statXp = filtered.mutable_stat_xp();
|
||||
statXp->set_strength_xp(hero.strength_xp());
|
||||
@@ -80,4 +80,4 @@ using net::eagle0::shardok::api::HeroView;
|
||||
return filtered;
|
||||
}
|
||||
|
||||
} // namespace shardok
|
||||
} // namespace shardok
|
||||
|
||||
@@ -34,6 +34,8 @@ TEST_F(WatcherFilterTest, AlliedParticipantHeroStatsVisibleToWatcher) {
|
||||
vector<Unit> attackerUnits;
|
||||
attackerUnits.push_back(GetUnitT1());
|
||||
attackerUnits.back().mutable_location() = Coords(4, 0);
|
||||
attackerUnits.back().mutable_attached_hero().mutate_vigor(42);
|
||||
attackerUnits.back().mutable_attached_hero().mutate_starting_vigor(88);
|
||||
|
||||
vector<Unit> defenderUnits;
|
||||
defenderUnits.push_back(GetUnitT2());
|
||||
@@ -58,6 +60,8 @@ TEST_F(WatcherFilterTest, AlliedParticipantHeroStatsVisibleToWatcher) {
|
||||
for (const auto& uv : watcherView.units()) {
|
||||
if (uv.player_id() == 0 && uv.has_attached_hero() && uv.attached_hero().has_stats()) {
|
||||
foundAllyWithHeroStats = true;
|
||||
EXPECT_DOUBLE_EQ(42, uv.attached_hero().stats().vigor());
|
||||
EXPECT_DOUBLE_EQ(88, uv.attached_hero().stats().starting_vigor());
|
||||
// Ally battalion stats also revealed.
|
||||
EXPECT_TRUE(uv.battalion().has_armament());
|
||||
EXPECT_TRUE(uv.battalion().has_morale());
|
||||
|
||||
Reference in New Issue
Block a user