Skip to content

Commit

Permalink
improve bow-hit
Browse files Browse the repository at this point in the history
  • Loading branch information
Try committed Aug 31, 2019
1 parent 853097f commit 6a3c19d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Game/world/npc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1140,9 +1140,6 @@ void Npc::takeDamage(Npc &other, const Bullet *b) {
perceptionProcess(other,this,0,PERC_ASSESSDAMAGE);
owner.sendPassivePerc(*this,other,*this,PERC_ASSESSOTHERSDAMAGE);

if(!isDown())
owner.emitWeaponsSound(other,*this);

lastHit = &other;
fghAlgo.onTakeHit();
implFaiWait(0);
Expand All @@ -1151,6 +1148,12 @@ void Npc::takeDamage(Npc &other, const Bullet *b) {
int dmg = isImmortal() ? 0 : other.damageValue(*this,b);
if(isPlayer() && owner.script().isRamboMode())
dmg = std::min(1,dmg);

if(dmg<=0)
return;

if(!isDown())
owner.emitWeaponsSound(other,*this);
changeAttribute(ATR_HITPOINTS,-dmg,b==nullptr);

if(isUnconscious()){
Expand Down

0 comments on commit 6a3c19d

Please sign in to comment.