1
This commit is contained in:
parent
f581e25e26
commit
d373f5e8b7
@ -8,6 +8,8 @@
|
||||
#include "room.h"
|
||||
#include "mapinstance.h"
|
||||
#include "creature.h"
|
||||
#include "human.h"
|
||||
#include "stats.h"
|
||||
|
||||
#include "mt/Map.h"
|
||||
|
||||
@ -28,6 +30,9 @@ bool Movement::UpdatePosition()
|
||||
curr_point.curr_pos.AddGlmVec3(curr_point.dir * owner_->GetSpeed());
|
||||
owner_->SetPos(curr_point.curr_pos);
|
||||
owner_->room->map_instance->CheckTerrain(owner_, curr_point.same_polys_flags, curr_point.spec_polys);
|
||||
if (owner_->IsHuman()) {
|
||||
owner_->AsHuman()->stats->IncMoveDistance(owner_->GetSpeed());
|
||||
}
|
||||
}
|
||||
if (owner_->GetPos().Distance2D2(curr_point.src_pos) - curr_point.distance >= 0.0001f) {
|
||||
#ifdef MYDEBUG1
|
||||
|
@ -377,3 +377,10 @@ void PlayerStats::AdjustRewardData()
|
||||
EmptyStrToZero(over_reward.weapon2.gold_limit);
|
||||
}
|
||||
}
|
||||
|
||||
void PlayerStats::IncMoveDistance(float distance)
|
||||
{
|
||||
if (a8::GtOrEqZero(distance)) {
|
||||
move_distance += distance;
|
||||
}
|
||||
}
|
||||
|
@ -136,11 +136,14 @@ class PlayerStats
|
||||
std::vector<WeaponStatsPb> pb_weapons_stats;
|
||||
int star_num = 0;
|
||||
|
||||
float move_distance = 0.0f;
|
||||
|
||||
WeaponStats& MustBeWeapon(int weapon_id);
|
||||
void IncWeaponKills(int weapon_id, int val);
|
||||
void IncWeaponDamageOut(int weapon_id, int val);
|
||||
void IncWeaponObtainCount(int weapon_id, int val);
|
||||
void IncWeaponUseTimes(int weapon_id, int val);
|
||||
void IncMoveDistance(float distance);
|
||||
HeroStats& MustBeHero(int hero_id);
|
||||
void SetHeroSkillLv(int hero_id, int skill_lv);
|
||||
void SetHeroWeaponLv(int hero_id, int weapon_lv);
|
||||
|
Loading…
x
Reference in New Issue
Block a user