1
This commit is contained in:
parent
c0740d18ea
commit
6b470c5fd3
@ -396,6 +396,9 @@ void Car::DecHP(float dec_hp, int killer_id, const std::string killer_name, int
|
|||||||
float old_health = GetHP();
|
float old_health = GetHP();
|
||||||
float new_health = std::max(0.0f, GetHP() - dec_hp);
|
float new_health = std::max(0.0f, GetHP() - dec_hp);
|
||||||
SetHP(std::max(0.0f, new_health));
|
SetHP(std::max(0.0f, new_health));
|
||||||
|
if (old_health - GetHP() > 0.001f) {
|
||||||
|
real_dmg_out = old_health - GetHP();
|
||||||
|
}
|
||||||
if (GetHP() <= 0.0001f && !IsDead(room)) {
|
if (GetHP() <= 0.0001f && !IsDead(room)) {
|
||||||
BeKill(killer_id, killer_name, weapon_id);
|
BeKill(killer_id, killer_name, weapon_id);
|
||||||
}
|
}
|
||||||
|
@ -287,6 +287,9 @@ void Hero::DecHP(float dec_hp, int killer_id, const std::string killer_name, int
|
|||||||
float old_health = GetHP();
|
float old_health = GetHP();
|
||||||
float new_health = std::max(0.0f, GetHP() - dec_hp);
|
float new_health = std::max(0.0f, GetHP() - dec_hp);
|
||||||
SetHP(std::max(0.0f, new_health));
|
SetHP(std::max(0.0f, new_health));
|
||||||
|
if (old_health - GetHP() > 0.001f) {
|
||||||
|
real_dmg_out = old_health - GetHP();
|
||||||
|
}
|
||||||
if (new_health < old_health && room->IsPveRoom()) {
|
if (new_health < old_health && room->IsPveRoom()) {
|
||||||
room->pve_data.AddDamageInfo(killer_id, GetUniId(), old_health - new_health);
|
room->pve_data.AddDamageInfo(killer_id, GetUniId(), old_health - new_health);
|
||||||
}
|
}
|
||||||
|
@ -269,7 +269,11 @@ void Human::DecHP(float dec_hp, int killer_id, const std::string killer_name, in
|
|||||||
last_receive_dmg_frameno = room->GetFrameNo();
|
last_receive_dmg_frameno = room->GetFrameNo();
|
||||||
float old_hp = GetHP();
|
float old_hp = GetHP();
|
||||||
if (armor_shield > 0.0001f){
|
if (armor_shield > 0.0001f){
|
||||||
|
float old_armor_shield = armor_shield;
|
||||||
armor_shield = std::max(0.0f, armor_shield - dec_hp);
|
armor_shield = std::max(0.0f, armor_shield - dec_hp);
|
||||||
|
if (old_armor_shield - armor_shield > 0.001f) {
|
||||||
|
real_dmg_out = old_armor_shield - armor_shield;
|
||||||
|
}
|
||||||
room->frame_event.AddPropChg
|
room->frame_event.AddPropChg
|
||||||
(
|
(
|
||||||
GetWeakPtrRef(),
|
GetWeakPtrRef(),
|
||||||
@ -279,7 +283,11 @@ void Human::DecHP(float dec_hp, int killer_id, const std::string killer_name, in
|
|||||||
false);
|
false);
|
||||||
GetTrigger()->ReceiveDmg();
|
GetTrigger()->ReceiveDmg();
|
||||||
} else if (energy_shield > 0.001f) {
|
} else if (energy_shield > 0.001f) {
|
||||||
|
float old_energy_shield = energy_shield;
|
||||||
energy_shield = std::max(0.0f, energy_shield - dec_hp);
|
energy_shield = std::max(0.0f, energy_shield - dec_hp);
|
||||||
|
if (old_energy_shield - energy_shield > 0.001f) {
|
||||||
|
real_dmg_out = old_energy_shield - energy_shield;
|
||||||
|
}
|
||||||
room->frame_event.AddPropChg
|
room->frame_event.AddPropChg
|
||||||
(
|
(
|
||||||
GetWeakPtrRef(),
|
GetWeakPtrRef(),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user