Skip to content

Commit 6a3c19d

Browse files
committed
improve bow-hit
1 parent 853097f commit 6a3c19d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Game/world/npc.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,9 +1140,6 @@ void Npc::takeDamage(Npc &other, const Bullet *b) {
11401140
perceptionProcess(other,this,0,PERC_ASSESSDAMAGE);
11411141
owner.sendPassivePerc(*this,other,*this,PERC_ASSESSOTHERSDAMAGE);
11421142

1143-
if(!isDown())
1144-
owner.emitWeaponsSound(other,*this);
1145-
11461143
lastHit = &other;
11471144
fghAlgo.onTakeHit();
11481145
implFaiWait(0);
@@ -1151,6 +1148,12 @@ void Npc::takeDamage(Npc &other, const Bullet *b) {
11511148
int dmg = isImmortal() ? 0 : other.damageValue(*this,b);
11521149
if(isPlayer() && owner.script().isRamboMode())
11531150
dmg = std::min(1,dmg);
1151+
1152+
if(dmg<=0)
1153+
return;
1154+
1155+
if(!isDown())
1156+
owner.emitWeaponsSound(other,*this);
11541157
changeAttribute(ATR_HITPOINTS,-dmg,b==nullptr);
11551158

11561159
if(isUnconscious()){

0 commit comments

Comments
 (0)