Puch improvement to make properly battles

There was an Problem with making damage to enemy, if you don't stop attacking without waiting for cool down (full_punch_interval)
I fixed it (line 3834):
const ToolCapabilities *toolcap = &playeritem.getToolCapabilities(gamedef->idef());
		if (runData->time_from_last_punch < toolcap->full_punch_interval) {
			do_punch = false;
			do_punch_damage = false;
		}
This commit is contained in:
Alex Gordon 2016-05-11 20:37:23 +02:00
parent 8bb9e467d6
commit 4003d3b93b
1 changed files with 6 additions and 0 deletions

View File

@ -3830,6 +3830,12 @@ void Game::handlePointingAtObject(GameRunData *runData,
if (input->getLeftClicked())
do_punch = true;
const ToolCapabilities *toolcap = &playeritem.getToolCapabilities(gamedef->idef());
if (runData->time_from_last_punch < toolcap->full_punch_interval) {
do_punch = false;
do_punch_damage = false;
}
if (do_punch) {
infostream << "Left-clicked object" << std::endl;