Skip to content

Commit

Permalink
Equipment: Make durability decrease framerate independent
Browse files Browse the repository at this point in the history
This particular durabilty decrease is executed for each frame of the
strike where the weapon is colliding with something.

Fixes: issue #790
  • Loading branch information
dscharrer committed Jan 13, 2018
1 parent 551eee4 commit 58eecde
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/game/Equipment.cpp
Expand Up @@ -56,6 +56,8 @@ ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.

#include "animation/Animation.h"

#include "core/Core.h"

#include "game/Damage.h"
#include "game/EntityManager.h"
#include "game/Equipment.h"
Expand Down Expand Up @@ -761,8 +763,9 @@ bool ARX_EQUIPMENT_Strike_Check(Entity * io_source, Entity * io_weapon, float ra
}
}

if(io_source == entities.player())
ARX_DAMAGES_DurabilityCheck(io_weapon, 0.2f);
if(io_source == entities.player()) {
ARX_DAMAGES_DurabilityCheck(io_weapon, g_framedelay * 0.006f);
}
}

if((target->ioflags & IO_NPC) && (dmgs > 0.f || target->spark_n_blood == SP_BLOODY)) {
Expand Down

0 comments on commit 58eecde

Please sign in to comment.